Class: Spree::Money
- Inherits:
-
Object
- Object
- Spree::Money
- Defined in:
- lib/spree/money.rb
Instance Method Summary collapse
-
#initialize(amount, options = {}) ⇒ Money
constructor
A new instance of Money.
- #to_s ⇒ Object
Constructor Details
#initialize(amount, options = {}) ⇒ Money
Returns a new instance of Money.
5 6 7 8 9 10 |
# File 'lib/spree/money.rb', line 5 def initialize(amount, ={}) @money = ::Money.new(amount * 100, Spree::Config[:currency]) @options = {} @options[:with_currency] = true if Spree::Config[:display_currency] @options.merge!() end |
Instance Method Details
#to_s ⇒ Object
12 13 14 |
# File 'lib/spree/money.rb', line 12 def to_s @money.format(@options) end |