Sha256: 9cc44b7d58b9bbe506fa268ca1ef347f9f6498cca3ee9176705f58cf04348065

Contents?: true

Size: 364 Bytes

Versions: 14

Compression:

Stored size: 364 Bytes

Contents

# encoding: UTF-8
require 'nokogiri'

module Correios
  module Frete
    class Parser
      def servicos(xml)
        servicos = {}

        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

14 entries across 14 versions & 1 rubygems

Version Path
correios-frete-1.5.2 lib/correios/frete/parser.rb
correios-frete-1.5.1 lib/correios/frete/parser.rb
correios-frete-1.5.0 lib/correios/frete/parser.rb
correios-frete-1.4.0 lib/correios/frete/parser.rb
correios-frete-1.3.3 lib/correios/frete/parser.rb
correios-frete-1.3.2 lib/correios/frete/parser.rb
correios-frete-1.3.1 lib/correios/frete/parser.rb
correios-frete-1.3.0 lib/correios/frete/parser.rb
correios-frete-1.2.1 lib/correios/frete/parser.rb
correios-frete-1.2.0 lib/correios/frete/parser.rb
correios-frete-1.1.0 lib/correios/frete/parser.rb
correios-frete-1.0.2 lib/correios/frete/parser.rb
correios-frete-1.0.1 lib/correios/frete/parser.rb
correios-frete-1.0.0 lib/correios/frete/parser.rb