Class: Rapa::Price
- Inherits:
-
Object
- Object
- Rapa::Price
- Defined in:
- lib/rapa/price.rb
Instance Attribute Summary collapse
- #source ⇒ Hash readonly
Instance Method Summary collapse
- #amount ⇒ Integer
- #currency_code ⇒ String
- #formatted_price ⇒ String
-
#initialize(source) ⇒ Price
constructor
A new instance of Price.
Constructor Details
#initialize(source) ⇒ Price
Returns a new instance of Price.
7 8 9 |
# File 'lib/rapa/price.rb', line 7 def initialize(source) @source = source end |
Instance Attribute Details
#source ⇒ Hash (readonly)
4 5 6 |
# File 'lib/rapa/price.rb', line 4 def source @source end |
Instance Method Details
#amount ⇒ Integer
12 13 14 |
# File 'lib/rapa/price.rb', line 12 def amount source["Amount"].to_i end |
#currency_code ⇒ String
17 18 19 |
# File 'lib/rapa/price.rb', line 17 def currency_code source["CurrencyCode"] end |
#formatted_price ⇒ String
22 23 24 |
# File 'lib/rapa/price.rb', line 22 def formatted_price source["FormattedPrice"] end |