Sha256: 89359c4604dd3db6beee578343930ee6cf309ec5f20d527fce27391a3b0a76e2

Contents?: true

Size: 981 Bytes

Versions: 4

Compression:

Stored size: 981 Bytes

Contents

require 'money_s3/parsers/base_parser'
require 'money_s3/parsers/dalsi_sazba'

module MoneyS3
  module Parsers
    class SouhrnDPHType
      include BaseParser

      def zaklad0
        at 'Zaklad0'
      end

      def zaklad5
        at 'Zaklad5'
      end

      def zaklad22
        at 'Zaklad22'
      end

      def dph5
        at 'DPH5'
      end

      def dph22
        at 'DPH22'
      end

      def seznam_dalsi_sazby
        array_of_at(DalsiSazba, ['SeznamDalsiSazby', 'DalsiSazba'])
      end

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

        hash[:zaklad0] = zaklad0 if has? 'Zaklad0'
        hash[:zaklad5] = zaklad5 if has? 'Zaklad5'
        hash[:zaklad22] = zaklad22 if has? 'Zaklad22'
        hash[:dph5] = dph5 if has? 'DPH5'
        hash[:dph22] = dph22 if has? 'DPH22'
        hash[:seznam_dalsi_sazby] = seznam_dalsi_sazby.map(&:to_h_with_attrs) if has? 'SeznamDalsiSazby'

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