Sha256: b7e56e5da055ff45cafc202e69059e479a1f52c600b39acbb29b97cec2766584

Contents?: true

Size: 1.06 KB

Versions: 7

Compression:

Stored size: 1.06 KB

Contents

module MoneyS3
  module Parsers
    class KurzListekType
      include ParserCore::BaseParser

      def banka
        at 'Banka'
      end

      def banka_attributes
        attributes_at 'Banka'
      end

      def por_cislo
        at 'PorCislo'
      end

      def por_cislo_attributes
        attributes_at 'PorCislo'
      end

      def datum
        at 'Datum'
      end

      def datum_attributes
        attributes_at 'Datum'
      end

      def seznam_kurzu
        array_of_at(KurzType, ['SeznamKurzu', 'Kurz'])
      end

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

        hash[:banka] = banka if has? 'Banka'
        hash[:banka_attributes] = banka_attributes if has? 'Banka'
        hash[:por_cislo] = por_cislo if has? 'PorCislo'
        hash[:por_cislo_attributes] = por_cislo_attributes if has? 'PorCislo'
        hash[:datum] = datum if has? 'Datum'
        hash[:datum_attributes] = datum_attributes if has? 'Datum'
        hash[:seznam_kurzu] = seznam_kurzu.map(&:to_h) if has? 'SeznamKurzu'

        hash
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

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