Class: SepaFileParser::Owner

Inherits:
Object
  • Object
show all
Defined in:
lib/sepa_file_parser/general/owner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(xml_data) ⇒ Owner

Returns a new instance of Owner.



9
10
11
# File 'lib/sepa_file_parser/general/owner.rb', line 9

def initialize(xml_data)
  @xml_data = xml_data
end

Instance Attribute Details

#xml_dataObject (readonly)

Returns the value of attribute xml_data.



7
8
9
# File 'lib/sepa_file_parser/general/owner.rb', line 7

def xml_data
  @xml_data
end

Instance Method Details

#nameString

Returns:



14
15
16
# File 'lib/sepa_file_parser/general/owner.rb', line 14

def name
  @name ||= xml_data.xpath('Nm/text()').text
end

#postal_addressSepaFileParser::PostalAddress?



19
20
21
22
23
24
25
# File 'lib/sepa_file_parser/general/owner.rb', line 19

def postal_address # May be missing
  postal_address = xml_data.xpath('PstlAdr')

  return nil if postal_address == nil || postal_address.empty?

  @address ||= SepaFileParser::PostalAddress.new(postal_address)
end