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



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

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

#priceObject



12
13
14
# File 'lib/money/orm/generic.rb', line 12

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

#price=(price) ⇒ Object



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

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