Class: CanadaPost::Rate
- Inherits:
-
Object
- Object
- CanadaPost::Rate
- Defined in:
- lib/canada_post/rate.rb
Instance Attribute Summary collapse
-
#am_delivery ⇒ Object
Returns the value of attribute am_delivery.
-
#expected_delivery_date ⇒ Object
Returns the value of attribute expected_delivery_date.
-
#expected_transit_time ⇒ Object
Returns the value of attribute expected_transit_time.
-
#guaranteed_delivery ⇒ Object
Returns the value of attribute guaranteed_delivery.
-
#rate_type ⇒ Object
Returns the value of attribute rate_type.
-
#service_code ⇒ Object
Returns the value of attribute service_code.
-
#service_link ⇒ Object
Returns the value of attribute service_link.
-
#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.
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.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/canada_post/rate.rb', line 8 def initialize(={}) @service_type = [:service_name] @service_code = [:service_code] @service_link = [:service_link] @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] @expected_transit_time = [:service_standard][:expected_transit_time] @expected_delivery_date = [:service_standard][:expected_delivery_date] @guaranteed_delivery = [:service_standard][:guaranteed_delivery] @am_delivery = [:service_standard][:am_delivery] end |
Instance Attribute Details
#am_delivery ⇒ Object
Returns the value of attribute am_delivery.
4 5 6 |
# File 'lib/canada_post/rate.rb', line 4 def am_delivery @am_delivery end |
#expected_delivery_date ⇒ Object
Returns the value of attribute expected_delivery_date.
4 5 6 |
# File 'lib/canada_post/rate.rb', line 4 def expected_delivery_date @expected_delivery_date end |
#expected_transit_time ⇒ Object
Returns the value of attribute expected_transit_time.
4 5 6 |
# File 'lib/canada_post/rate.rb', line 4 def expected_transit_time @expected_transit_time end |
#guaranteed_delivery ⇒ Object
Returns the value of attribute guaranteed_delivery.
4 5 6 |
# File 'lib/canada_post/rate.rb', line 4 def guaranteed_delivery @guaranteed_delivery end |
#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_link ⇒ Object
Returns the value of attribute service_link.
4 5 6 |
# File 'lib/canada_post/rate.rb', line 4 def service_link @service_link 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 |
Instance Method Details
#total_taxes ⇒ Object
23 24 25 |
# File 'lib/canada_post/rate.rb', line 23 def total_taxes (@gst_taxes.to_f + @pst_taxes.to_f + @hst_taxes.to_f).to_s end |