Class: SwissVillageDirectory::Village
- Inherits:
-
Object
- Object
- SwissVillageDirectory::Village
- Defined in:
- lib/swiss_village_directory/village.rb
Instance Attribute Summary collapse
-
#canton ⇒ Object
readonly
Returns the value of attribute canton.
-
#commune ⇒ Object
readonly
Returns the value of attribute commune.
-
#latitude ⇒ Object
readonly
Returns the value of attribute latitude.
-
#longitude ⇒ Object
readonly
Returns the value of attribute longitude.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#one_digit_spare ⇒ Object
readonly
Returns the value of attribute one_digit_spare.
-
#zip_code ⇒ Object
readonly
Returns the value of attribute zip_code.
Instance Method Summary collapse
-
#initialize(name, zip_code, one_digit_spare, commune, canton, longitude, latitude) ⇒ Village
constructor
A new instance of Village.
Constructor Details
#initialize(name, zip_code, one_digit_spare, commune, canton, longitude, latitude) ⇒ Village
Returns a new instance of Village.
5 6 7 8 9 10 11 12 13 |
# File 'lib/swiss_village_directory/village.rb', line 5 def initialize(name, zip_code, one_digit_spare, commune, canton, longitude, latitude) @name = name @zip_code = zip_code.to_i @one_digit_spare = one_digit_spare.to_i @commune = commune @canton = canton @longitude = longitude.to_f @latitude = latitude.to_f end |
Instance Attribute Details
#canton ⇒ Object (readonly)
Returns the value of attribute canton.
3 4 5 |
# File 'lib/swiss_village_directory/village.rb', line 3 def canton @canton end |
#commune ⇒ Object (readonly)
Returns the value of attribute commune.
3 4 5 |
# File 'lib/swiss_village_directory/village.rb', line 3 def commune @commune end |
#latitude ⇒ Object (readonly)
Returns the value of attribute latitude.
3 4 5 |
# File 'lib/swiss_village_directory/village.rb', line 3 def latitude @latitude end |
#longitude ⇒ Object (readonly)
Returns the value of attribute longitude.
3 4 5 |
# File 'lib/swiss_village_directory/village.rb', line 3 def longitude @longitude end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/swiss_village_directory/village.rb', line 3 def name @name end |
#one_digit_spare ⇒ Object (readonly)
Returns the value of attribute one_digit_spare.
3 4 5 |
# File 'lib/swiss_village_directory/village.rb', line 3 def one_digit_spare @one_digit_spare end |
#zip_code ⇒ Object (readonly)
Returns the value of attribute zip_code.
3 4 5 |
# File 'lib/swiss_village_directory/village.rb', line 3 def zip_code @zip_code end |