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