Class: SepaFileParser::PostalAddress
- Inherits:
-
Object
- Object
- SepaFileParser::PostalAddress
- Defined in:
- lib/sepa_file_parser/general/postal_address.rb
Instance Attribute Summary collapse
-
#xml_data ⇒ Object
readonly
Returns the value of attribute xml_data.
Instance Method Summary collapse
- #building_number ⇒ String
- #country ⇒ String
-
#initialize(xml_data) ⇒ PostalAddress
constructor
A new instance of PostalAddress.
- #lines ⇒ Array<String>
- #postal_code ⇒ String
- #street_name ⇒ String
- #town_name ⇒ String
Constructor Details
#initialize(xml_data) ⇒ PostalAddress
Returns a new instance of PostalAddress.
8 9 10 |
# File 'lib/sepa_file_parser/general/postal_address.rb', line 8 def initialize(xml_data) @xml_data = xml_data end |
Instance Attribute Details
#xml_data ⇒ Object (readonly)
Returns the value of attribute xml_data.
6 7 8 |
# File 'lib/sepa_file_parser/general/postal_address.rb', line 6 def xml_data @xml_data end |
Instance Method Details
#building_number ⇒ String
25 26 27 |
# File 'lib/sepa_file_parser/general/postal_address.rb', line 25 def building_number # May be missing xml_data.xpath('BldgNb/text()').text end |
#country ⇒ String
40 41 42 |
# File 'lib/sepa_file_parser/general/postal_address.rb', line 40 def country # May be missing xml_data.xpath('Ctry/text()').text end |
#lines ⇒ Array<String>
13 14 15 16 17 |
# File 'lib/sepa_file_parser/general/postal_address.rb', line 13 def lines # May be empty xml_data.xpath('AdrLine').map do |x| x.xpath('text()').text end end |
#postal_code ⇒ String
30 31 32 |
# File 'lib/sepa_file_parser/general/postal_address.rb', line 30 def postal_code # May be missing xml_data.xpath('PstCd/text()').text end |
#street_name ⇒ String
20 21 22 |
# File 'lib/sepa_file_parser/general/postal_address.rb', line 20 def street_name # May be missing xml_data.xpath('StrtNm/text()').text end |
#town_name ⇒ String
35 36 37 |
# File 'lib/sepa_file_parser/general/postal_address.rb', line 35 def town_name # May be missing xml_data.xpath('TwnNm/text()').text end |