Class: MoneyS3::Parsers::KomponentaType

Inherits:
Object
  • Object
show all
Includes:
ParserCore::BaseParser
Defined in:
lib/money_s3/parsers/komponenta_type.rb

Instance Method Summary collapse

Instance Method Details

#km_kartaObject



18
19
20
# File 'lib/money_s3/parsers/komponenta_type.rb', line 18

def km_karta
  submodel_at(KmKartaType, 'KmKarta')
end

#poc_mjObject



6
7
8
# File 'lib/money_s3/parsers/komponenta_type.rb', line 6

def poc_mj
  at 'PocMJ'
end

#poc_mj_attributesObject



10
11
12
# File 'lib/money_s3/parsers/komponenta_type.rb', line 10

def poc_mj_attributes
  attributes_at 'PocMJ'
end

#skladObject



22
23
24
# File 'lib/money_s3/parsers/komponenta_type.rb', line 22

def sklad
  submodel_at(SkladType, 'Sklad')
end

#stav_zasobyObject



14
15
16
# File 'lib/money_s3/parsers/komponenta_type.rb', line 14

def stav_zasoby
  submodel_at(StavZasobyType, 'StavZasoby')
end

#to_hObject



26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/money_s3/parsers/komponenta_type.rb', line 26

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

  hash[:poc_mj] = poc_mj if has? 'PocMJ'
  hash[:poc_mj_attributes] = poc_mj_attributes if has? 'PocMJ'
  hash[:stav_zasoby] = stav_zasoby.to_h if has? 'StavZasoby'
  hash[:km_karta] = km_karta.to_h if has? 'KmKarta'
  hash[:sklad] = sklad.to_h if has? 'Sklad'

  hash
end