correios 0.7.0 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/correios.rb +3 -2
- data/lib/correios/version.rb +1 -1
- metadata +1 -1
data/lib/correios.rb
CHANGED
@@ -115,7 +115,8 @@ class Correios
|
|
115
115
|
}
|
116
116
|
|
117
117
|
params = params.to_a.map {|item| item.to_a.join('=')} .join('&')
|
118
|
-
|
118
|
+
xml_str = open("#{host}#{path}?#{params}").read
|
119
|
+
xml = XmlSimple.xml_in(xml_str)
|
119
120
|
|
120
121
|
setup_services xml, servicos
|
121
122
|
end
|
@@ -128,7 +129,7 @@ class Correios
|
|
128
129
|
if xml["cServico"].size > 1
|
129
130
|
servicos = {}
|
130
131
|
xml["cServico"].each do |servico|
|
131
|
-
servicos[Servico::SERVICOS[servico["Codigo"].
|
132
|
+
servicos[Servico::SERVICOS[servico["Codigo"].first.to_i]] = Servico.new(servico) rescue nil
|
132
133
|
end
|
133
134
|
else
|
134
135
|
servicos = Servico.new(xml["cServico"].first)
|
data/lib/correios/version.rb
CHANGED