Sha256: 0012d957571d7f82f49be0f43b7d2bf1b2e2951f110ba7ae2df1f93a9898bf34

Contents?: true

Size: 842 Bytes

Versions: 4

Compression:

Stored size: 842 Bytes

Contents

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

module MoneyS3
  module Parsers
    class DoklRefType
      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/dokl_ref_type.rb
money_s3-0.9.0 lib/money_s3/parsers/dokl_ref_type.rb
money_s3-0.8.0 lib/money_s3/parsers/dokl_ref_type.rb
money_s3-0.7.0 lib/money_s3/parsers/dokl_ref_type.rb