Class: CorreiosApi::PreShipping

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ PreShipping

Returns a new instance of PreShipping.



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/correios_api/pre_shipping.rb', line 4

def initialize response
  @response = response
  @external_id = response.id
  @tracking_code = response.codigoObjeto
  @service_code = response.codigoServico
  @payment_method_id = response.modalidadePagamento
  @price = response.precoPrePostagem
  @items = response.itensDeclaracaoConteudo
  @post_prevision = response.dataPrevistaPostagem
  @posting_deadline = response.prazoPostagem
  @status = response.statusAtual
  @status_detail = response.descStatusAtual
  @label_type = response.tipoRotulo
  @package_type = response.tipoObjeto
end

Instance Attribute Details

#external_idObject (readonly)

Returns the value of attribute external_id.



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

def external_id
  @external_id
end

#itemsObject (readonly)

Returns the value of attribute items.



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

def items
  @items
end

#label_typeObject (readonly)

Returns the value of attribute label_type.



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

def label_type
  @label_type
end

#package_typeObject (readonly)

Returns the value of attribute package_type.



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

def package_type
  @package_type
end

#payment_method_idObject (readonly)

Returns the value of attribute payment_method_id.



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

def payment_method_id
  @payment_method_id
end

#post_previsionObject (readonly)

Returns the value of attribute post_prevision.



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

def post_prevision
  @post_prevision
end

#posting_deadlineObject (readonly)

Returns the value of attribute posting_deadline.



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

def posting_deadline
  @posting_deadline
end

#priceObject (readonly)

Returns the value of attribute price.



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

def price
  @price
end

#responseObject (readonly)

Returns the value of attribute response.



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

def response
  @response
end

#service_codeObject (readonly)

Returns the value of attribute service_code.



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

def service_code
  @service_code
end

#statusObject (readonly)

Returns the value of attribute status.



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

def status
  @status
end

#status_detailObject (readonly)

Returns the value of attribute status_detail.



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

def status_detail
  @status_detail
end

#tracking_codeObject (readonly)

Returns the value of attribute tracking_code.



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

def tracking_code
  @tracking_code
end