Sha256: 6c2f576165bced68134581e3e034fc04c44d13b00f4862e8a39983e4495cc63e

Contents?: true

Size: 653 Bytes

Versions: 7

Compression:

Stored size: 653 Bytes

Contents

module CorreiosSigep
  module Builders
    module XML
      class CollectObjects
        def initialize(builder, objects=[])
          @builder = builder
          @objects = objects
        end

        def build_xml
          @objects.each do |object|
            @builder.obj_col do
              build_item(object)
            end
          end
        end

        private
        def build_item(object)
          @builder.item     object.item
          @builder.id       object.id
          @builder.desc     object.description
          @builder.entrega  object.ship
          @builder.num      object.num
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
correios_sigep-2.2.0 lib/correios_sigep/builders/xml/collect_objects.rb
correios_sigep-2.1.1 lib/correios_sigep/builders/xml/collect_objects.rb
correios_sigep-2.1.0 lib/correios_sigep/builders/xml/collect_objects.rb
correios_sigep-2.0.0 lib/correios_sigep/builders/xml/collect_objects.rb
correios_sigep-1.0.2 lib/correios_sigep/builders/xml/collect_objects.rb
correios_sigep-1.0.1 lib/correios_sigep/builders/xml/collect_objects.rb
correios_sigep-1.0.0 lib/correios_sigep/builders/xml/collect_objects.rb