Sha256: dd182c2b366005fee0026f7265dd805a4c65f626ebe91736747b6451e353934d

Contents?: true

Size: 722 Bytes

Versions: 2

Compression:

Stored size: 722 Bytes

Contents

module MoneyS3
  module Parsers
    class KusovnikType
      include ParserCore::BaseParser

      def header
        submodel_at(HeaderKusovnikType, 'Header')
      end

      def child
        submodel_at(ChildKusovnikType, 'Child')
      end

      def seznam_komponent
        array_of_at(KomponentaKusovnikType, ['SeznamKomponent', 'Komponenta'])
      end

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

        hash[:header] = header.to_h_with_attrs if has? 'Header'
        hash[:child] = child.to_h_with_attrs if has? 'Child'
        hash[:seznam_komponent] = seznam_komponent.map(&:to_h_with_attrs) if has? 'SeznamKomponent'

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