Sha256: bc5267c38e1cee874d80028414bab42c1bdd0b9fc92bb9bfc01a5b9dbee7d627

Contents?: true

Size: 822 Bytes

Versions: 2

Compression:

Stored size: 822 Bytes

Contents

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

      def adresa
        submodel_at(MessageType, 'Adresa')
      end

      def polozka
        array_of_at(MessageType, ['Polozka'])
      end

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

      def data
        submodel_at(PokDoklType, 'Data')
      end

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

        hash[:adresa] = adresa.to_h_with_attrs if has? 'Adresa'
        hash[:polozka] = polozka.map(&:to_h_with_attrs) if has? 'Polozka'
        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_pok_dokl_type.rb
money_s3-0.11.0 lib/money_s3/parsers/msg_pok_dokl_type.rb