Sha256: 45af5337ddef375ff906edc18dffdcf3085a583febb5869dd9248bceb46d759d

Contents?: true

Size: 793 Bytes

Versions: 6

Compression:

Stored size: 793 Bytes

Contents

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

      def dod_odb
        submodel_at(MsgFirmaType, 'DodOdb')
      end

      def konec_prij
        submodel_at(MsgFirmaType, 'KonecPrij')
      end

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

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

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

        hash[:dod_odb] = dod_odb.to_h if has? 'DodOdb'
        hash[:konec_prij] = konec_prij.to_h if has? 'KonecPrij'
        hash[:polozka] = polozka.map(&:to_h) if has? 'Polozka'
        hash[:uhrada] = uhrada.map(&:to_h) if has? 'Uhrada'

        hash
        super.merge(hash)
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

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