Sha256: 2a7879f02b8826e2f1ec1131e6d443e41c8799a855a5b547378868d354eb66d1

Contents?: true

Size: 623 Bytes

Versions: 2

Compression:

Stored size: 623 Bytes

Contents

module MoneyS3
  module Parsers
    class MessageType
      include ParserCore::BaseParser

      def status
        at 'Status'
      end

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

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

      def to_h_with_attrs
        hash = ParserCore::HashWithAttributes.new({}, attributes)

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

        hash
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
money_s3-0.12.0 lib/money_s3/parsers/message_type.rb
money_s3-0.11.0 lib/money_s3/parsers/message_type.rb