Skip to content

Instantly share code, notes, and snippets.

@quirkey
Created October 10, 2008 14:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save quirkey/16056 to your computer and use it in GitHub Desktop.
Save quirkey/16056 to your computer and use it in GitHub Desktop.
[10:29 AM:n41(master)] $ ./script/console
Loading development environment (Rails 2.1.1)
>> m1, m2 = Money.new(200), Money.new(200)
=> [#<Money:0x32165f8 @currency="USD", @cents=200>, #<Money:0x32165e4 @currency="USD", @cents=200>]
>> m2.eql?(m1)
=> true
>> m1.eql?(m2)
=> true
>> m1 == m2
=> true
>> [m1,m2].uniq
=> [#<Money:0x32165f8 @currency="USD", @cents=200>, #<Money:0x32165e4 @currency="USD", @cents=200>]
>> [m1,m2].uniq!
=> nil
>> [1,1]
=> [1, 1]
>> [1,1].uniq
=> [1]
>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment