Class: CorreiosApi::Rate
- Inherits:
-
Object
- Object
- CorreiosApi::Rate
- Defined in:
- lib/correios_api/rate.rb
Instance Attribute Summary collapse
-
#delivery_time_in_days ⇒ Object
readonly
Returns the value of attribute delivery_time_in_days.
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#max_delivery_time ⇒ Object
readonly
Returns the value of attribute max_delivery_time.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#price ⇒ Object
readonly
Returns the value of attribute price.
-
#service_code ⇒ Object
readonly
Returns the value of attribute service_code.
-
#service_name ⇒ Object
readonly
Returns the value of attribute service_name.
Instance Method Summary collapse
-
#initialize(service_name:, service_code:, price:, delivery_time_in_days:, max_delivery_time:, message: nil, errors: []) ⇒ Rate
constructor
A new instance of Rate.
Constructor Details
#initialize(service_name:, service_code:, price:, delivery_time_in_days:, max_delivery_time:, message: nil, errors: []) ⇒ Rate
Returns a new instance of Rate.
4 5 6 7 8 9 10 11 12 |
# File 'lib/correios_api/rate.rb', line 4 def initialize service_name:, service_code:, price:, delivery_time_in_days:, max_delivery_time:, message: nil, errors: [] @service_name = service_name @service_code = service_code @price = transform_price(price) @delivery_time_in_days = delivery_time_in_days @max_delivery_time = transform_date(max_delivery_time) @message = @errors = errors end |
Instance Attribute Details
#delivery_time_in_days ⇒ Object (readonly)
Returns the value of attribute delivery_time_in_days.
3 4 5 |
# File 'lib/correios_api/rate.rb', line 3 def delivery_time_in_days @delivery_time_in_days end |
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
3 4 5 |
# File 'lib/correios_api/rate.rb', line 3 def errors @errors end |
#max_delivery_time ⇒ Object (readonly)
Returns the value of attribute max_delivery_time.
3 4 5 |
# File 'lib/correios_api/rate.rb', line 3 def max_delivery_time @max_delivery_time end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
3 4 5 |
# File 'lib/correios_api/rate.rb', line 3 def @message end |
#price ⇒ Object (readonly)
Returns the value of attribute price.
3 4 5 |
# File 'lib/correios_api/rate.rb', line 3 def price @price end |
#service_code ⇒ Object (readonly)
Returns the value of attribute service_code.
3 4 5 |
# File 'lib/correios_api/rate.rb', line 3 def service_code @service_code end |
#service_name ⇒ Object (readonly)
Returns the value of attribute service_name.
3 4 5 |
# File 'lib/correios_api/rate.rb', line 3 def service_name @service_name end |