Sha256: 78846ac16dfeb305c0dba1a8368b6d99a051f45aab9b5cf30057b24af6b7c7e1

Contents?: true

Size: 1005 Bytes

Versions: 1

Compression:

Stored size: 1005 Bytes

Contents

require 'money_s3/parsers/base_parser'
require 'money_s3/parsers/pol_inv_dokl_type'

module MoneyS3
  module Parsers
    class InvDoklType
      include 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
        hash = WithAttributes.new({})
        hash.attributes = 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) if has? 'Polozka'

        hash
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
money_s3-0.6.0 lib/money_s3/parsers/inv_dokl_type.rb