Class: IbgeLocalidades::Mesorregiao

Inherits:
Object
  • Object
show all
Extended by:
IbgeLocalidades
Defined in:
lib/ibge_localidades/mesorregiao.rb

Constant Summary collapse

PATH =
"/mesorregioes/"

Constants included from IbgeLocalidades

MAIN_URL, VERSION

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#estadoObject (readonly)

Returns the value of attribute estado.



5
6
7
# File 'lib/ibge_localidades/mesorregiao.rb', line 5

def estado
  @estado
end

#idObject (readonly)

Returns the value of attribute id.



5
6
7
# File 'lib/ibge_localidades/mesorregiao.rb', line 5

def id
  @id
end

#nomeObject (readonly)

Returns the value of attribute nome.



5
6
7
# File 'lib/ibge_localidades/mesorregiao.rb', line 5

def nome
  @nome
end