Sha256: f2edfb7f4792c6803eff45207766fd609633119e0efd5ba178450cd0903f96b7

Contents?: true

Size: 822 Bytes

Versions: 1

Compression:

Stored size: 822 Bytes

Contents

require 'money_s3/parsers/base_parser'
require 'money_s3/parsers/stav_zasoby_type'
require 'money_s3/parsers/km_karta_type'
require 'money_s3/parsers/sklad_type'

module MoneyS3
  module Parsers
    class KomponentaType
      include BaseParser

      def poc_mj
        at :PocMJ
      end

      def stav_zasoby
        submodel_at(StavZasobyType, :StavZasoby)
      end

      def km_karta
        submodel_at(KmKartaType, :KmKarta)
      end

      def sklad
        submodel_at(SkladType, :Sklad)
      end

      def to_h
        hash = {}

        hash[:poc_mj] = poc_mj if raw.key? :PocMJ
        hash[:stav_zasoby] = stav_zasoby.to_h if raw.key? :StavZasoby
        hash[:km_karta] = km_karta.to_h if raw.key? :KmKarta
        hash[:sklad] = sklad.to_h if raw.key? :Sklad

        hash
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
money_s3-0.5.0 lib/money_s3/parsers/komponenta_type.rb