Class: SepaFileParser::Pain002::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/sepa_file_parser/pain002/base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(xml_data) ⇒ Base

Returns a new instance of Base.



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/sepa_file_parser/pain002/base.rb', line 8

def initialize(xml_data)
  @xml_data = xml_data
  # CstmrPmtStsRpt = Customer Payment Status Report
  grphdr = xml_data.xpath('CstmrPmtStsRpt/GrpHdr')
  @group_header = SepaFileParser::GroupHeader.new(grphdr)

  reports = xml_data.xpath('CstmrPmtStsRpt/OrgnlPmtInfAndSts')
  @reports = reports.map { |x| Report.new(x) }

  group_information_and_status = xml_data.xpath('CstmrPmtStsRpt/OrgnlGrpInfAndSts')
  @group_information_and_status = GroupInformation.new(group_information_and_status)
end

Instance Attribute Details

#group_headerObject (readonly)

Returns the value of attribute group_header.



6
7
8
# File 'lib/sepa_file_parser/pain002/base.rb', line 6

def group_header
  @group_header
end

#group_information_and_statusObject (readonly)

Returns the value of attribute group_information_and_status.



6
7
8
# File 'lib/sepa_file_parser/pain002/base.rb', line 6

def group_information_and_status
  @group_information_and_status
end

#reportsObject (readonly)

Returns the value of attribute reports.



6
7
8
# File 'lib/sepa_file_parser/pain002/base.rb', line 6

def reports
  @reports
end

#xml_dataObject (readonly)

Returns the value of attribute xml_data.



6
7
8
# File 'lib/sepa_file_parser/pain002/base.rb', line 6

def xml_data
  @xml_data
end