Class: RubyARES::Address
- Inherits:
-
Object
- Object
- RubyARES::Address
- Defined in:
- lib/ruby-ares/address.rb
Instance Attribute Summary collapse
-
#city ⇒ Object
readonly
ID_adresy.
-
#city_part ⇒ Object
readonly
ID_adresy.
-
#house_number ⇒ Object
readonly
ID_adresy.
-
#house_number_type ⇒ Object
readonly
ID_adresy.
-
#id ⇒ Object
readonly
ID_adresy.
-
#orientational_number ⇒ Object
readonly
ID_adresy.
-
#postcode ⇒ Object
readonly
ID_adresy.
-
#street ⇒ Object
readonly
ID_adresy.
Instance Method Summary collapse
- #city_line ⇒ Object
-
#initialize(id, street, postcode, city, city_part, house_number, house_number_type, orientational_number) ⇒ Address
constructor
A new instance of Address.
- #street_line ⇒ Object
- #street_number ⇒ Object
- #to_str ⇒ Object
Constructor Details
#initialize(id, street, postcode, city, city_part, house_number, house_number_type, orientational_number) ⇒ Address
Returns a new instance of Address.
14 15 16 17 18 19 20 21 22 23 24 |
# 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 |
Instance Attribute Details
#city ⇒ Object (readonly)
ID_adresy
5 6 7 |
# File 'lib/ruby-ares/address.rb', line 5 def city @city end |
#city_part ⇒ Object (readonly)
ID_adresy
5 6 7 |
# File 'lib/ruby-ares/address.rb', line 5 def city_part @city_part end |
#house_number ⇒ Object (readonly)
ID_adresy
5 6 7 |
# File 'lib/ruby-ares/address.rb', line 5 def house_number @house_number end |
#house_number_type ⇒ Object (readonly)
ID_adresy
5 6 7 |
# File 'lib/ruby-ares/address.rb', line 5 def house_number_type @house_number_type end |
#id ⇒ Object (readonly)
ID_adresy
5 6 7 |
# File 'lib/ruby-ares/address.rb', line 5 def id @id end |
#orientational_number ⇒ Object (readonly)
ID_adresy
5 6 7 |
# File 'lib/ruby-ares/address.rb', line 5 def orientational_number @orientational_number end |
#postcode ⇒ Object (readonly)
ID_adresy
5 6 7 |
# File 'lib/ruby-ares/address.rb', line 5 def postcode @postcode end |
#street ⇒ Object (readonly)
ID_adresy
5 6 7 |
# File 'lib/ruby-ares/address.rb', line 5 def street @street end |
Instance Method Details
#city_line ⇒ Object
47 48 49 |
# File 'lib/ruby-ares/address.rb', line 47 def city_line "#{@postcode} #{@city}" end |
#street_line ⇒ Object
43 44 45 |
# File 'lib/ruby-ares/address.rb', line 43 def street_line "#{@street} #{street_number}" end |
#street_number ⇒ Object
35 36 37 38 39 40 41 |
# File 'lib/ruby-ares/address.rb', line 35 def street_number unless @orientational_number @house_number else "#{@orientational_number}/#{@house_number}" end end |
#to_str ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'lib/ruby-ares/address.rb', line 26 def to_str @city_part = '' if @city == @city_part <<EOF #{self.street} #{self.street_number} #{self.postcode} #{self.city} #{self.city_part} EOF end |