correios-ws 5 → 6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +2 -2
- data/lib/correios-ws.rb +8 -4
- data/lib/correios-ws/version.rb +1 -1
- metadata +1 -1
data/README.md
CHANGED
@@ -89,8 +89,8 @@ puts esedex_com_contrato.valor_declarado
|
|
89
89
|
puts esedex_com_contrato.prazo_entrega
|
90
90
|
puts esedex_com_contrato.entrega_domiciliar
|
91
91
|
puts esedex_com_contrato.entrega_sabado
|
92
|
-
puts esedex_com_contrato.
|
93
|
-
puts esedex_com_contrato.
|
92
|
+
puts esedex_com_contrato.erro?
|
93
|
+
puts esedex_com_contrato.msg_erro
|
94
94
|
|
95
95
|
# Searching by CEP
|
96
96
|
|
data/lib/correios-ws.rb
CHANGED
@@ -166,12 +166,16 @@ module Correios
|
|
166
166
|
:entrega_domiciliar,
|
167
167
|
:entrega_sabado,
|
168
168
|
:valor_mao_propria,
|
169
|
-
:
|
170
|
-
:
|
169
|
+
:erro,
|
170
|
+
:msg_erro)
|
171
171
|
|
172
172
|
def initialize
|
173
173
|
yield self if block_given?
|
174
174
|
end
|
175
|
+
|
176
|
+
def erro?
|
177
|
+
@erro
|
178
|
+
end
|
175
179
|
end
|
176
180
|
|
177
181
|
class Result
|
@@ -200,8 +204,8 @@ module Correios
|
|
200
204
|
s.entrega_domiciliar = cservico['EntregaDomiciliar']
|
201
205
|
s.entrega_sabado = cservico['EntregaSabado']
|
202
206
|
#Informacoes de Erro
|
203
|
-
s.
|
204
|
-
s.
|
207
|
+
s.erro = cservico['Erro'].to_s != '0'
|
208
|
+
s.msg_erro = s.erro? ? (cservico['Erro'].to_i * -1).to_s + ' - ' + cservico['MsgErro'] : ''
|
205
209
|
end
|
206
210
|
end
|
207
211
|
|
data/lib/correios-ws/version.rb
CHANGED