Sha256: 10c5b97cedf29d1e47e9d8d4ff0064c7fb7f7f1b0a2b711f924c54141ba3f4c1

Contents?: true

Size: 746 Bytes

Versions: 4

Compression:

Stored size: 746 Bytes

Contents

require 'money_s3/parsers/base_parser'
require 'money_s3/parsers/kurz_type'

module MoneyS3
  module Parsers
    class KurzListek
      include BaseParser

      def banka
        at 'Banka'
      end

      def por_cislo
        at 'PorCislo'
      end

      def datum
        at 'Datum'
      end

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

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

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

        hash
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
money_s3-0.10.0 lib/money_s3/parsers/kurz_listek.rb
money_s3-0.9.0 lib/money_s3/parsers/kurz_listek.rb
money_s3-0.8.0 lib/money_s3/parsers/kurz_listek.rb
money_s3-0.7.0 lib/money_s3/parsers/kurz_listek.rb