class CanadaPost::Rate

Attributes

rate_type[RW]
service_code[RW]
service_type[RW]
total_base_charge[RW]
total_net_charge[RW]
transit_time[RW]

Public Class Methods

new(options={}) click to toggle source
# File lib/canada_post/rate.rb, line 5
def initialize(options={})
  @service_type = options[:service_name]
  @service_code = options[:service_code]
  @total_net_charge = options[:price_details][:due]
  @total_base_charge = options[:price_details][:base]
  @gst_taxes = options[:price_details][:taxes][:gst]
  @pst_taxes = options[:price_details][:taxes][:pst]
  @hst_taxes = options[:price_details][:taxes][:hst]
  @transit_time = options[:service_standard][:expected_transit_time]
end

Public Instance Methods

total_taxes() click to toggle source
# File lib/canada_post/rate.rb, line 16
def total_taxes
  (@gst_taxes.to_f + @pst_taxes.to_f + @hst_taxes.to_f).to_s
end