Class: IbgeLocalidades::Cidade
- Inherits:
-
Object
- Object
- IbgeLocalidades::Cidade
- Extended by:
- IbgeLocalidades
- Defined in:
- lib/ibge_localidades/cidade.rb
Constant Summary collapse
- PATH =
"/municipios/"
Constants included from IbgeLocalidades
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#microrregiao ⇒ Object
readonly
Returns the value of attribute microrregiao.
-
#nome ⇒ Object
readonly
Returns the value of attribute nome.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Cidade
constructor
A new instance of Cidade.
Methods included from IbgeLocalidades
as_objects, buscar_por_relacionamento, find_by_id, get, listar
Constructor Details
#initialize(params = {}) ⇒ Cidade
11 12 13 14 15 |
# File 'lib/ibge_localidades/cidade.rb', line 11 def initialize(params={}) @id = params["id"] @nome = params["nome"] @microrregiao = ::IbgeLocalidades::Microrregiao.new(params["microrregiao"]) end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
5 6 7 |
# File 'lib/ibge_localidades/cidade.rb', line 5 def id @id end |
#microrregiao ⇒ Object (readonly)
Returns the value of attribute microrregiao.
5 6 7 |
# File 'lib/ibge_localidades/cidade.rb', line 5 def microrregiao @microrregiao end |
#nome ⇒ Object (readonly)
Returns the value of attribute nome.
5 6 7 |
# File 'lib/ibge_localidades/cidade.rb', line 5 def nome @nome end |