Class: CanadaPost::Rate
- Inherits:
-
Object
- Object
- CanadaPost::Rate
- Defined in:
- lib/canada_post/rate.rb
Instance Attribute Summary collapse
-
#rate_type ⇒ Object
Returns the value of attribute rate_type.
-
#service_code ⇒ Object
Returns the value of attribute service_code.
-
#service_type ⇒ Object
Returns the value of attribute service_type.
-
#total_base_charge ⇒ Object
Returns the value of attribute total_base_charge.
-
#total_net_charge ⇒ Object
Returns the value of attribute total_net_charge.
-
#transit_time ⇒ Object
Returns the value of attribute transit_time.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Rate
constructor
A new instance of Rate.
- #total_taxes ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Rate
Returns a new instance of Rate.
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/canada_post/rate.rb', line 5 def initialize(={}) @service_type = [:service_name] @service_code = [:service_code] @total_net_charge = [:price_details][:due] @total_base_charge = [:price_details][:base] @gst_taxes = [:price_details][:taxes][:gst] @pst_taxes = [:price_details][:taxes][:pst] @hst_taxes = [:price_details][:taxes][:hst] @transit_time = [:service_standard][:expected_transit_time] end |
Instance Attribute Details
#rate_type ⇒ Object
Returns the value of attribute rate_type.
4 5 6 |
# File 'lib/canada_post/rate.rb', line 4 def rate_type @rate_type end |
#service_code ⇒ Object
Returns the value of attribute service_code.
4 5 6 |
# File 'lib/canada_post/rate.rb', line 4 def service_code @service_code end |
#service_type ⇒ Object
Returns the value of attribute service_type.
4 5 6 |
# File 'lib/canada_post/rate.rb', line 4 def service_type @service_type end |
#total_base_charge ⇒ Object
Returns the value of attribute total_base_charge.
4 5 6 |
# File 'lib/canada_post/rate.rb', line 4 def total_base_charge @total_base_charge end |
#total_net_charge ⇒ Object
Returns the value of attribute total_net_charge.
4 5 6 |
# File 'lib/canada_post/rate.rb', line 4 def total_net_charge @total_net_charge end |
#transit_time ⇒ Object
Returns the value of attribute transit_time.
4 5 6 |
# File 'lib/canada_post/rate.rb', line 4 def transit_time @transit_time end |
Instance Method Details
#total_taxes ⇒ Object
16 17 18 |
# 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 |