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