Class: SwissVillageDirectory::Village

Inherits:
Object
  • Object
show all
Defined in:
lib/swiss_village_directory/village.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#cantonObject (readonly)

Returns the value of attribute canton.



3
4
5
# File 'lib/swiss_village_directory/village.rb', line 3

def canton
  @canton
end

#communeObject (readonly)

Returns the value of attribute commune.



3
4
5
# File 'lib/swiss_village_directory/village.rb', line 3

def commune
  @commune
end

#latitudeObject (readonly)

Returns the value of attribute latitude.



3
4
5
# File 'lib/swiss_village_directory/village.rb', line 3

def latitude
  @latitude
end

#longitudeObject (readonly)

Returns the value of attribute longitude.



3
4
5
# File 'lib/swiss_village_directory/village.rb', line 3

def longitude
  @longitude
end

#nameObject (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_spareObject (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_codeObject (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