Skip to content

Instantly share code, notes, and snippets.

@catwell
Created April 15, 2011 08:55
Show Gist options
  • Save catwell/921422 to your computer and use it in GitHub Desktop.
Save catwell/921422 to your computer and use it in GitHub Desktop.
WTF Ruby?
irb(main):095:0> x == y
=> true
irb(main):096:0> cur_users.include?(x)
=> false
irb(main):097:0> cur_users.include?(y)
=> true
irb(main):098:0> cur_users.class
=> Set
@catwell
Copy link
Author

catwell commented Apr 15, 2011

Even better:

irb(main):099:0> cur_users2 = cur_users.to_a; nil
=> nil
irb(main):100:0> cur_users2.include?(x)
=> true
irb(main):101:0> cur_users3 = Set.new(cur_users2); nil
=> nil
irb(main):102:0> cur_users3.include?(x)
=> false

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment