Skip to content

Instantly share code, notes, and snippets.

@Mon-Ouie
Created August 8, 2015 16:03
Show Gist options
  • Save Mon-Ouie/a4e4a383ced809929f85 to your computer and use it in GitHub Desktop.
Save Mon-Ouie/a4e4a383ced809929f85 to your computer and use it in GitHub Desktop.
pry(main):12> ab = 1
=> 1
pry(main):13> c = 2
=> 2
pry(main):14> abc = Set.new [ab, c]
=> #<Set: {1, 2}>
pry(main):15> abc > c
ArgumentError: value must be a set
from /usr/lib/ruby/2.2.0/set.rb:226:in `proper_superset?'
pry(main):16> abc > Set.new([c])
=> true
pry(main):17> abc - c
ArgumentError: value must be enumerable
from /usr/lib/ruby/2.2.0/set.rb:98:in `do_with_enum'
pry(main):18> abc - Set.new([c])
=> #<Set: {1}>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment