Sha256: 4e66fdaafe3f67058b98adff144458969fae086db87d0fca0a2365986d13597f

Contents?: true

Size: 798 Bytes

Versions: 2

Compression:

Stored size: 798 Bytes

Contents

module MoneyS3
  module Parsers
    class MsgBanDoklType < MessageType
      include ParserCore::BaseParser

      def adresa
        submodel_at(MessageType, 'Adresa')
      end

      def ucet
        submodel_at(MessageType, 'Ucet')
      end

      def uhrada
        array_of_at(MessageType, ['Uhrada'])
      end

      def data
        submodel_at(BanDoklType, 'Data')
      end

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

        hash[:adresa] = adresa.to_h_with_attrs if has? 'Adresa'
        hash[:ucet] = ucet.to_h_with_attrs if has? 'Ucet'
        hash[:uhrada] = uhrada.map(&:to_h_with_attrs) if has? 'Uhrada'
        hash[:data] = data.to_h_with_attrs if has? 'Data'

        hash
        super.merge(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/msg_ban_dokl_type.rb
money_s3-0.11.0 lib/money_s3/parsers/msg_ban_dokl_type.rb