Class: MoneyS3::Parsers::MsgPrevodkaType

Inherits:
MessageType show all
Includes:
ParserCore::BaseParser
Defined in:
lib/money_s3/parsers/msg_prevodka_type.rb

Instance Method Summary collapse

Methods inherited from MessageType

#data, #data_attributes, #error_info, #reference, #status, #status_attributes

Instance Method Details

#dod_odbObject



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

def dod_odb
  submodel_at(MsgFirmaType, 'DodOdb')
end

#konec_prijObject



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

def konec_prij
  submodel_at(MsgFirmaType, 'KonecPrij')
end

#polozkaObject



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

def polozka
  array_of_at(MsgPolozType, ['Polozka'])
end

#sklad_pro_prObject



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

def sklad_pro_pr
  submodel_at(MessageType, 'SkladProPr')
end

#to_hObject



22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/money_s3/parsers/msg_prevodka_type.rb', line 22

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

  hash[:sklad_pro_pr] = sklad_pro_pr.to_h if has? 'SkladProPr'
  hash[:dod_odb] = dod_odb.to_h if has? 'DodOdb'
  hash[:konec_prij] = konec_prij.to_h if has? 'KonecPrij'
  hash[:polozka] = polozka.map(&:to_h) if has? 'Polozka'

  hash
  super.merge(hash)
end