class EME::Billing::Offer
Public Class Methods
new(key_values)
click to toggle source
# File lib/eme/billing.rb, line 426 def initialize(key_values) key_values.each do |k,v| self[k.to_sym] = v end if self[:items] local_items = [] self[:items].each {|item| local_items << Item.new(item)} self[:items] = local_items end end
Public Instance Methods
price(currency = "USD")
click to toggle source
# File lib/eme/billing.rb, line 437 def price(currency = "USD") prod = self.prices.select{|p| p["currency"] == currency}.first return prod["price"].to_f end