class Municipitaly::Municipality
Define data structure for a Municipality
Attributes
cadastrial_code[R]
cadastrial code of municipality (String)
name[R]
name of municipality (String)
population[R]
total population of municipality (Integer)
postal_codes[R]
an Array of one or more postal code (as String)
province_istat[R]
istat code relative to parent province (String)
Public Class Methods
all()
click to toggle source
returns an array of all Municipitaly::Municipality
objects.
# File lib/municipitaly/municipality.rb, line 43 def self.all data.municipalities end
Public Instance Methods
istat()
click to toggle source
returns istat code for current municipality.
# File lib/municipitaly/municipality.rb, line 48 def istat province_istat + partial_istat end
province()
click to toggle source
returns Municipitaly::Province
object for current municipality.
# File lib/municipitaly/municipality.rb, line 53 def province @province ||= Search.province_from_istat(province_istat) end