Sha256: 184dcdfdf91d646c6148d4f1de496715aecb9239daa32ff9be126bcfa8315bbd

Contents?: true

Size: 809 Bytes

Versions: 7

Compression:

Stored size: 809 Bytes

Contents

module MoneyS3
  module Parsers
    class ParametrKartaType
      include ParserCore::BaseParser

      def parametr
        submodel_at(ParametrType, 'Parametr')
      end

      def poradi
        at 'Poradi'
      end

      def poradi_attributes
        attributes_at 'Poradi'
      end

      def value
        at 'Value'
      end

      def value_attributes
        attributes_at 'Value'
      end

      def to_h
        hash = {}
        hash[:attributes] = attributes

        hash[:parametr] = parametr.to_h if has? 'Parametr'
        hash[:poradi] = poradi if has? 'Poradi'
        hash[:poradi_attributes] = poradi_attributes if has? 'Poradi'
        hash[:value] = value if has? 'Value'
        hash[:value_attributes] = value_attributes if has? 'Value'

        hash
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
money_s3-2.4.1 lib/money_s3/parsers/parametr_karta_type.rb
money_s3-2.4.0 lib/money_s3/parsers/parametr_karta_type.rb
money_s3-2.3.0 lib/money_s3/parsers/parametr_karta_type.rb
money_s3-2.2.0 lib/money_s3/parsers/parametr_karta_type.rb
money_s3-2.1.0 lib/money_s3/parsers/parametr_karta_type.rb
money_s3-2.0.0 lib/money_s3/parsers/parametr_karta_type.rb
money_s3-1.0.0 lib/money_s3/parsers/parametr_karta_type.rb