class CamtParser::PostalAddress

Attributes

xml_data[R]

Public Class Methods

new(xml_data) click to toggle source
# File lib/camt_parser/general/postal_address.rb, line 6
def initialize(xml_data)
  @xml_data = xml_data
end

Public Instance Methods

building_number() click to toggle source

@return [String]

# File lib/camt_parser/general/postal_address.rb, line 23
def building_number # May be missing
  xml_data.xpath('BldgNb/text()').text
end
country() click to toggle source

@return [String]

# File lib/camt_parser/general/postal_address.rb, line 38
def country # May be missing
  xml_data.xpath('Ctry/text()').text
end
lines() click to toggle source

@return [Array<String>]

# File lib/camt_parser/general/postal_address.rb, line 11
def lines # May be empty
  xml_data.xpath('AdrLine').map do |x|
    x.xpath('text()').text
  end
end
postal_code() click to toggle source

@return [String]

# File lib/camt_parser/general/postal_address.rb, line 28
def postal_code # May be missing
  xml_data.xpath('PstCd/text()').text
end
street_name() click to toggle source

@return [String]

# File lib/camt_parser/general/postal_address.rb, line 18
def street_name # May be missing
  xml_data.xpath('StrtNm/text()').text
end
town_name() click to toggle source

@return [String]

# File lib/camt_parser/general/postal_address.rb, line 33
def town_name # May be missing
  xml_data.xpath('TwnNm/text()').text
end