Class: QuickTravel::PricingDetails

Inherits:
Adapter
  • Object
show all
Defined in:
lib/quick_travel/product.rb

Instance Method Summary collapse

Methods inherited from Adapter

all, belongs_to, create, find, has_many, #to_s, update

Methods included from InitFromHash

#define_readers, #initialize, #to_hash

Instance Method Details

#adjustments_to_apply_in_centsObject

define to avoid auto definition as money getter due to _in_cents postfix



134
135
136
# File 'lib/quick_travel/product.rb', line 134

def adjustments_to_apply_in_cents
  @adjustments_to_apply_in_cents
end

#convert_pax_type_hash(pax_type_hash) ⇒ Object



142
143
144
# File 'lib/quick_travel/product.rb', line 142

def convert_pax_type_hash(pax_type_hash)
  pax_type_hash.each.with_object({}) { |(type, cents), hash| hash[type.to_i] = Money.new(cents.to_i) }
end

#price_per_pax_type=(pax_type_hash) ⇒ Object



138
139
140
# File 'lib/quick_travel/product.rb', line 138

def price_per_pax_type=(pax_type_hash)
  @price_per_pax_type = convert_pax_type_hash(pax_type_hash)
end