Sha256: 51ca1ecb49fc0c670f66395eab382f348b5477911ab90efd62d3355d32fdd1b5

Contents?: true

Size: 1.17 KB

Versions: 1

Compression:

Stored size: 1.17 KB

Contents

require 'money_s3/parsers/base_parser'
require 'money_s3/parsers/e_shop_info'
require 'money_s3/parsers/ekategorie_type'

module MoneyS3
  module Parsers
    class EkategorieType
      include BaseParser

      def id
        at 'ID'
      end

      def name
        at 'Name'
      end

      def descript
        at 'Descript'
      end

      def in_changed
        at 'IN_Changed'
      end

      def no_public
        at 'NoPublic'
      end

      def e_shop_info
        submodel_at(EShopInfo, 'eShopInfo')
      end

      def seznam_podr_kategorii
        array_of_at(EkategorieType, ['SeznamPodrKategorii', 'eKategorie'])
      end

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

        hash[:id] = id if has? 'ID'
        hash[:name] = name if has? 'Name'
        hash[:descript] = descript if has? 'Descript'
        hash[:in_changed] = in_changed if has? 'IN_Changed'
        hash[:no_public] = no_public if has? 'NoPublic'
        hash[:e_shop_info] = e_shop_info.to_h if has? 'eShopInfo'
        hash[:seznam_podr_kategorii] = seznam_podr_kategorii.map(&:to_h) if has? 'SeznamPodrKategorii'

        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/ekategorie_type.rb