Module: Money::Orm::Generic

Included in:
Mongoid::Monetizable
Defined in:
lib/money/orm/generic.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#currencyObject



22
23
24
# File 'lib/money/orm/generic.rb', line 22

def currency
  ::Money::Currency.new(currency_iso)
end

#priceObject



15
16
17
# File 'lib/money/orm/generic.rb', line 15

def price
  ::Money.new(self.price_pence, currency)
end

#price=(price) ⇒ Object



18
19
20
# File 'lib/money/orm/generic.rb', line 18

def price=(price)
  self.price_pence = price.cents
end