Class: MoneyS3::Parsers::MessageRootType

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

Direct Known Subclasses

ReportType

Instance Method Summary collapse

Instance Method Details

#error_infoObject



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

def error_info
  array_of_at(ErrorInfoType, ['ErrorInfo'])
end

#referenceObject



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

def reference
  array_of_at(String, ['Reference', 'ID'])
end

#statusObject



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

def status
  at 'Status'
end

#status_attributesObject



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

def status_attributes
  attributes_at 'Status'
end

#to_hObject



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

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

  hash[:status] = status if has? 'Status'
  hash[:status_attributes] = status_attributes if has? 'Status'
  hash[:reference] = reference if has? 'Reference'
  hash[:error_info] = error_info.map(&:to_h) if has? 'ErrorInfo'

  hash
end