Sha256: f47fc08ec15501f0a17eceac501a905c6665c46e3b715dfb0748f5558e22b94f

Contents?: true

Size: 945 Bytes

Versions: 2

Compression:

Stored size: 945 Bytes

Contents

module MoneyS3
  module Parsers
    class InvDoklType
      include ParserCore::BaseParser

      def cislo_d
        at 'CisloD'
      end

      def inv_id
        at 'InvID'
      end

      def popis
        at 'Popis'
      end

      def prac
        at 'Prac'
      end

      def kontr
        at 'Kontr'
      end

      def poznamka
        at 'Poznamka'
      end

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

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

        hash[:cislo_d] = cislo_d if has? 'CisloD'
        hash[:inv_id] = inv_id if has? 'InvID'
        hash[:popis] = popis if has? 'Popis'
        hash[:prac] = prac if has? 'Prac'
        hash[:kontr] = kontr if has? 'Kontr'
        hash[:poznamka] = poznamka if has? 'Poznamka'
        hash[:polozka] = polozka.map(&:to_h_with_attrs) if has? 'Polozka'

        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/inv_dokl_type.rb
money_s3-0.11.0 lib/money_s3/parsers/inv_dokl_type.rb