Sha256: ab92d47be8eb1556e7e833c9794d3febc94fe47f10161df0c7dc4896f494fee7

Contents?: true

Size: 794 Bytes

Versions: 1

Compression:

Stored size: 794 Bytes

Contents

require 'money_s3/parsers/base_parser'
require 'money_s3/parsers/valuty'

module MoneyS3
  module Parsers
    class SouhrnDPHPolType
      include BaseParser

      def zaklad_mj
        at 'Zaklad_MJ'
      end

      def dph_mj
        at 'DPH_MJ'
      end

      def zaklad
        at 'Zaklad'
      end

      def dph
        at 'DPH'
      end

      def valuty
        submodel_at(Valuty, 'Valuty')
      end

      def to_h
        hash = WithAttributes.new({})
        hash.attributes = attributes

        hash[:zaklad_mj] = zaklad_mj if has? 'Zaklad_MJ'
        hash[:dph_mj] = dph_mj if has? 'DPH_MJ'
        hash[:zaklad] = zaklad if has? 'Zaklad'
        hash[:dph] = dph if has? 'DPH'
        hash[:valuty] = valuty.to_h if has? 'Valuty'

        hash
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
money_s3-0.6.0 lib/money_s3/parsers/souhrn_dph_pol_type.rb