Sha256: 655110cf26dbf1293d9bdaeb2fe80e7c3acbf29fb868e40ea0bc252484c40584

Contents?: true

Size: 1.07 KB

Versions: 1

Compression:

Stored size: 1.07 KB

Contents

require 'money_s3/builders/base_builder'

module MoneyS3
  module Builders
    class ErrorInfoType
      include BaseBuilder

      def builder
        root = Ox::Element.new(element_name)

        if attributes.key? :error_type_coded
          element = Ox::Element.new('ErrorTypeCoded')
          element << attributes[:error_type_coded] if attributes[:error_type_coded]
          root << element
        end

        if attributes.key? :error_type_other
          element = Ox::Element.new('ErrorTypeOther')
          element << attributes[:error_type_other] if attributes[:error_type_other]
          root << element
        end

        if attributes.key? :error_code
          element = Ox::Element.new('ErrorCode')
          element << attributes[:error_code] if attributes[:error_code]
          root << element
        end

        if attributes.key? :error_description
          element = Ox::Element.new('ErrorDescription')
          element << attributes[:error_description] if attributes[:error_description]
          root << element
        end

        root
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
money_s3-0.5.0 lib/money_s3/builders/error_info_type.rb