class RubyARES::Address

Attributes

city[R]
city_part[R]
house_number[R]
house_number_type[R]
id[R]
orientational_number[R]
postcode[R]
street[R]

Public Class Methods

new(id, street, postcode, city, city_part, house_number, house_number_type, orientational_number) click to toggle source
# File lib/ruby-ares/address.rb, line 14
def initialize(id, street, postcode, city, city_part,
               house_number, house_number_type, orientational_number)
  @id = id
  @street = street
  @postcode = postcode
  @city = city
  @city_part = city_part
  @house_number = house_number
  @house_number_type = house_number_type
  @orientational_number = orientational_number
end

Public Instance Methods

city_line() click to toggle source
# File lib/ruby-ares/address.rb, line 46
def city_line
  "#{@postcode} #{@city}"
end
street_line() click to toggle source
# File lib/ruby-ares/address.rb, line 42
def street_line
  "#{@street} #{street_number}"
end
street_number() click to toggle source
# File lib/ruby-ares/address.rb, line 34
def street_number
  unless @orientational_number
    @house_number
  else
    "#{@orientational_number}/#{@house_number}"
  end
end
to_str() click to toggle source
# File lib/ruby-ares/address.rb, line 26
    def to_str
<<EOF
#{self.street.nil? ? self.city_part : self.street} #{self.street_number}
#{self.postcode} #{self.city}
#{self.city_part == self.city ? "" : self.city_part}
EOF
    end