Created
August 8, 2015 15:59
-
-
Save Mon-Ouie/5efdab278cbabc3922ac to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pry(main):1> ab = Set.new(['a', 'b']) | |
pry(main):1> require 'set' | |
=> true | |
pry(main):2> ab = Set.new(['a', 'b']) | |
=> #<Set: {"a", "b"}> | |
pry(main):3> c = Set.new(['c']) | |
=> #<Set: {"c"}> | |
pry(main):4> abc = Set.new [ab, c] | |
=> #<Set: {#<Set: {"a", "b"}>, #<Set: {"c"}>}> | |
pry(main):5> abc.include? c | |
=> true | |
pry(main):6> abc > c | |
=> false | |
pry(main):9> abc > Set.new([c]) | |
=> true | |
pry(main):10> abc - Set.new([c]) | |
=> #<Set: {#<Set: {"a", "b"}>}> | |
pry(main):11> abc - c | |
=> #<Set: {#<Set: {"a", "b"}>, #<Set: {"c"}>}> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment