| 1 |
# mruby-set |
| 2 |
|
| 3 |
Set class |
| 4 |
|
| 5 |
## Example |
| 6 |
|
| 7 |
```ruby |
| 8 |
set1 = Set.new([1,2]) |
| 9 |
set2 = Set[1,2,3] |
| 10 |
set3 = Set[4] |
| 11 |
|
| 12 |
set1 + set3 |
| 13 |
#=> #<Set: {1, 2, 4}> |
| 14 |
set2 - set1 |
| 15 |
#=> #<Set: {3}> |
| 16 |
set2 & set1 |
| 17 |
#=> #<Set: {1, 2}> |
| 18 |
set1 ^ set2 |
| 19 |
#=> #<Set: {3}> |
| 20 |
``` |
| 21 |
|
| 22 |
## Limitations |
| 23 |
|
| 24 |
These methods are not implemented yet: |
| 25 |
|
| 26 |
- freeze |
| 27 |
- to_set |
| 28 |
- divide(Set#divide with 2 arity block is not implemented.) |
| 29 |
|
| 30 |
## License |
| 31 |
|
| 32 |
Under the MIT License: |
| 33 |
|
| 34 |
- see [LICENSE](LICENSE) file |