Sha256: 7165be25329d3f3d2c1d157a361c92a823acbf7813ea1d16bdcc82c98fbb8128

Contents?: true

Size: 736 Bytes

Versions: 7

Compression:

Stored size: 736 Bytes

Contents

module MoneyS3
  module Parsers
    class MessageRootType
      include ParserCore::BaseParser

      def status
        at 'Status'
      end

      def status_attributes
        attributes_at 'Status'
      end

      def reference
        array_of_at(String, ['Reference', 'ID'])
      end

      def error_info
        array_of_at(ErrorInfoType, ['ErrorInfo'])
      end

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

        hash[:status] = status if has? 'Status'
        hash[:status_attributes] = status_attributes if has? 'Status'
        hash[:reference] = reference if has? 'Reference'
        hash[:error_info] = error_info.map(&:to_h) if has? 'ErrorInfo'

        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/message_root_type.rb
money_s3-2.4.0 lib/money_s3/parsers/message_root_type.rb
money_s3-2.3.0 lib/money_s3/parsers/message_root_type.rb
money_s3-2.2.0 lib/money_s3/parsers/message_root_type.rb
money_s3-2.1.0 lib/money_s3/parsers/message_root_type.rb
money_s3-2.0.0 lib/money_s3/parsers/message_root_type.rb
money_s3-1.0.0 lib/money_s3/parsers/message_root_type.rb