Class: Hash

Inherits:
Object
  • Object
show all
Defined in:
lib/monetize/core_extensions/hash.rb

Instance Method Summary collapse

Instance Method Details

#to_money(currency = nil) ⇒ Object



4
5
6
# File 'lib/monetize/core_extensions/hash.rb', line 4

def to_money(currency = nil)
  Money.new(self[:cents], self[:currency] || currency || Money.default_currency)
end