Method: Fedex::Rate#initialize

Defined in:
lib/fedex/rate.rb

#initialize(options = {}) ⇒ Rate

Returns a new instance of Rate.



22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/fedex/rate.rb', line 22

def initialize(options = {})
  @rate_type = options[:rate_type]
  @rate_zone = options[:rate_zone]
  @total_billing_weight = "#{options[:total_billing_weight][:value]} #{options[:total_billing_weight][:units]}"
  @total_freight_discounts = options[:total_freight_discounts]
  @total_net_charge = options[:total_net_charge][:amount]
  @total_taxes = options[:total_taxes][:amount]
  @total_net_freight = options[:total_net_freight][:amount]
  @total_surcharges = options[:total_surcharges][:amount]
  @total_base_charge = options[:total_base_charge][:amount]
  @total_net_fedex_charge = (options[:total_net_fe_dex_charge]||{})[:amount]
  @total_rebates = (options[:total_rebates]||{})[:amount]
end