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