Sha256: 01040d98d704f891f60a5c9b75749fd2c11d7b3f9ef16168c140188cda523ff7
Contents?: true
Size: 421 Bytes
Versions: 10
Compression:
Stored size: 421 Bytes
Contents
# encoding: UTF-8 require 'nokogiri' module Correios module Frete class Parser def servicos(xml) servicos = {} xml = xml.backward_encode("UTF-8", "ISO-8859-1") Nokogiri::XML(xml).root.elements.each do |element| servico = Correios::Frete::Servico.new.parse(element.to_xml) servicos[servico.tipo] = servico end servicos end end end end
Version data entries
10 entries across 10 versions & 1 rubygems