Class: IbgeLocalidades::Cidade

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

Constant Summary collapse

PATH =
"/municipios/"

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 = {}) ⇒ 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

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

#microrregiaoObject (readonly)

Returns the value of attribute microrregiao.



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

def microrregiao
  @microrregiao
end

#nomeObject (readonly)

Returns the value of attribute nome.



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

def nome
  @nome
end