Class: Spree::Price

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/spree/price.rb

Instance Method Summary collapse

Instance Method Details

#display_amountObject Also known as: display_price


8
9
10
# File 'app/models/spree/price.rb', line 8

def display_amount
  money
end

#moneyObject


13
14
15
# File 'app/models/spree/price.rb', line 13

def money
  Spree::Money.new(amount || 0, { currency: currency })
end

#priceObject


17
18
19
# File 'app/models/spree/price.rb', line 17

def price
  amount
end

#price=(price) ⇒ Object


21
22
23
# File 'app/models/spree/price.rb', line 21

def price=(price)
  self[:amount] = parse_price(price)
end