Class: SepaFileParser::Owner
- Inherits:
-
Object
- Object
- SepaFileParser::Owner
- Defined in:
- lib/sepa_file_parser/general/owner.rb
Instance Attribute Summary collapse
-
#xml_data ⇒ Object
readonly
Returns the value of attribute xml_data.
Instance Method Summary collapse
-
#initialize(xml_data) ⇒ Owner
constructor
A new instance of Owner.
- #name ⇒ String
- #postal_address ⇒ SepaFileParser::PostalAddress?
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_data ⇒ Object (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
#name ⇒ String
14 15 16 |
# File 'lib/sepa_file_parser/general/owner.rb', line 14 def name @name ||= xml_data.xpath('Nm/text()').text end |
#postal_address ⇒ SepaFileParser::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 |