Class: UPS::Parsers::RateParser
- Inherits:
-
Object
- Object
- UPS::Parsers::RateParser
- Defined in:
- lib/ups/parsers/rate_parser.rb
Instance Attribute Summary collapse
-
#rate ⇒ Object
readonly
Returns the value of attribute rate.
Instance Method Summary collapse
-
#initialize(rate) ⇒ RateParser
constructor
A new instance of RateParser.
- #rate_service_code ⇒ Object
- #rate_service_name ⇒ Object
- #to_h ⇒ Object
Constructor Details
#initialize(rate) ⇒ RateParser
Returns a new instance of RateParser.
9 10 11 |
# File 'lib/ups/parsers/rate_parser.rb', line 9 def initialize(rate) @rate = rate end |
Instance Attribute Details
#rate ⇒ Object (readonly)
Returns the value of attribute rate.
7 8 9 |
# File 'lib/ups/parsers/rate_parser.rb', line 7 def rate @rate end |
Instance Method Details
#rate_service_code ⇒ Object
26 27 28 |
# File 'lib/ups/parsers/rate_parser.rb', line 26 def rate_service_code rate_service[:Code] end |
#rate_service_name ⇒ Object
22 23 24 |
# File 'lib/ups/parsers/rate_parser.rb', line 22 def rate_service_name UPS::SERVICES[rate_service_code] end |
#to_h ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/ups/parsers/rate_parser.rb', line 13 def to_h { service_code: rate_service_code, service_name: rate_service_name, warnings: rate_warnings, total: rate_total } end |