Sha256: 79d7acf81b2c47f9ccb593125ad9cf7f474d4f6d31a679aa1bd3352076ace1cb

Contents?: true

Size: 841 Bytes

Versions: 4

Compression:

Stored size: 841 Bytes

Contents

require 'money_s3/parsers/base_parser'
require 'money_s3/parsers/eet_type'

module MoneyS3
  module Parsers
    class DokladHraz
      include BaseParser

      def id_dokladu
        at 'IDDokladu'
      end

      def cislo_dokladu
        at 'CisloDokladu'
      end

      def druh_dokladu
        at 'DruhDokladu'
      end

      def rok
        at 'Rok'
      end

      def eet
        submodel_at(EETType, 'EET')
      end

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

        hash[:id_dokladu] = id_dokladu if has? 'IDDokladu'
        hash[:cislo_dokladu] = cislo_dokladu if has? 'CisloDokladu'
        hash[:druh_dokladu] = druh_dokladu if has? 'DruhDokladu'
        hash[:rok] = rok if has? 'Rok'
        hash[:eet] = eet.to_h_with_attrs if has? 'EET'

        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/doklad_hraz.rb
money_s3-0.9.0 lib/money_s3/parsers/doklad_hraz.rb
money_s3-0.8.0 lib/money_s3/parsers/doklad_hraz.rb
money_s3-0.7.0 lib/money_s3/parsers/doklad_hraz.rb