Class: CorreiosApi::Rate

Inherits:
Object
  • Object
show all
Defined in:
lib/correios_api/rate.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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 = message
  @errors = errors
end

Instance Attribute Details

#delivery_time_in_daysObject (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

#errorsObject (readonly)

Returns the value of attribute errors.



3
4
5
# File 'lib/correios_api/rate.rb', line 3

def errors
  @errors
end

#max_delivery_timeObject (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

#messageObject (readonly)

Returns the value of attribute message.



3
4
5
# File 'lib/correios_api/rate.rb', line 3

def message
  @message
end

#priceObject (readonly)

Returns the value of attribute price.



3
4
5
# File 'lib/correios_api/rate.rb', line 3

def price
  @price
end

#service_codeObject (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_nameObject (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