Method: Price#initialize
- Defined in:
- lib/quick_travel/price.rb
#initialize(hash) ⇒ Price
Returns a new instance of Price.
4 5 6 7 8 9 |
# File 'lib/quick_travel/price.rb', line 4 def initialize(hash) cents = hash['cents'].to_i @dollars = cents / 100 @cents = cents % 100 @currency = hash['currency'] end |