Sha256: 9878ff388653aa2d6a1b67d6a68be8b870b091106bec5bb48dce3c404e5167c1

Contents?: true

Size: 1.44 KB

Versions: 7

Compression:

Stored size: 1.44 KB

Contents

module MoneyS3
  module Parsers
    class ErrorInfoType
      include ParserCore::BaseParser

      def error_type_coded
        at 'ErrorTypeCoded'
      end

      def error_type_coded_attributes
        attributes_at 'ErrorTypeCoded'
      end

      def error_type_other
        at 'ErrorTypeOther'
      end

      def error_type_other_attributes
        attributes_at 'ErrorTypeOther'
      end

      def error_code
        at 'ErrorCode'
      end

      def error_code_attributes
        attributes_at 'ErrorCode'
      end

      def error_description
        at 'ErrorDescription'
      end

      def error_description_attributes
        attributes_at 'ErrorDescription'
      end

      def to_h
        hash = {}
        hash[:attributes] = attributes

        hash[:error_type_coded] = error_type_coded if has? 'ErrorTypeCoded'
        hash[:error_type_coded_attributes] = error_type_coded_attributes if has? 'ErrorTypeCoded'
        hash[:error_type_other] = error_type_other if has? 'ErrorTypeOther'
        hash[:error_type_other_attributes] = error_type_other_attributes if has? 'ErrorTypeOther'
        hash[:error_code] = error_code if has? 'ErrorCode'
        hash[:error_code_attributes] = error_code_attributes if has? 'ErrorCode'
        hash[:error_description] = error_description if has? 'ErrorDescription'
        hash[:error_description_attributes] = error_description_attributes if has? 'ErrorDescription'

        hash
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
money_s3-2.4.1 lib/money_s3/parsers/error_info_type.rb
money_s3-2.4.0 lib/money_s3/parsers/error_info_type.rb
money_s3-2.3.0 lib/money_s3/parsers/error_info_type.rb
money_s3-2.2.0 lib/money_s3/parsers/error_info_type.rb
money_s3-2.1.0 lib/money_s3/parsers/error_info_type.rb
money_s3-2.0.0 lib/money_s3/parsers/error_info_type.rb
money_s3-1.0.0 lib/money_s3/parsers/error_info_type.rb