Class: SICONFIData

Inherits:
Object
  • Object
show all
Defined in:
lib/easy_siconfi/siconfi_data.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ SICONFIData

Returns a new instance of SICONFIData.



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/easy_siconfi/siconfi_data.rb', line 5

def initialize(hash)
	@exercicio = hash['exercicio']
	@periodo = hash['periodo']
	@periodicidade = hash['periodicidade']
	@instituicao = hash['instituicao']
	@uf = hash['uf']
	@populacao = hash['populacao']
	@rotulo = hash['rotulo']
	@coluna = hash['coluna']
	@conta = hash['conta']
	@valor = hash['valor']

	if hash.keys.index('co_poder') != nil then
		@co_poder = hash['co_poder']
	end
end

Instance Attribute Details

#co_poderObject

Returns the value of attribute co_poder.



2
3
4
# File 'lib/easy_siconfi/siconfi_data.rb', line 2

def co_poder
  @co_poder
end

#colunaObject

Returns the value of attribute coluna.



2
3
4
# File 'lib/easy_siconfi/siconfi_data.rb', line 2

def coluna
  @coluna
end

#contaObject

Returns the value of attribute conta.



2
3
4
# File 'lib/easy_siconfi/siconfi_data.rb', line 2

def conta
  @conta
end

#exercicioObject

Returns the value of attribute exercicio.



2
3
4
# File 'lib/easy_siconfi/siconfi_data.rb', line 2

def exercicio
  @exercicio
end

#instituicaoObject

Returns the value of attribute instituicao.



2
3
4
# File 'lib/easy_siconfi/siconfi_data.rb', line 2

def instituicao
  @instituicao
end

#periodicidadeObject

Returns the value of attribute periodicidade.



2
3
4
# File 'lib/easy_siconfi/siconfi_data.rb', line 2

def periodicidade
  @periodicidade
end

#periodoObject

Returns the value of attribute periodo.



2
3
4
# File 'lib/easy_siconfi/siconfi_data.rb', line 2

def periodo
  @periodo
end

#populacaoObject

Returns the value of attribute populacao.



2
3
4
# File 'lib/easy_siconfi/siconfi_data.rb', line 2

def populacao
  @populacao
end

#rotuloObject

Returns the value of attribute rotulo.



2
3
4
# File 'lib/easy_siconfi/siconfi_data.rb', line 2

def rotulo
  @rotulo
end

#ufObject

Returns the value of attribute uf.



2
3
4
# File 'lib/easy_siconfi/siconfi_data.rb', line 2

def uf
  @uf
end

#valorObject

Returns the value of attribute valor.



2
3
4
# File 'lib/easy_siconfi/siconfi_data.rb', line 2

def valor
  @valor
end

Instance Method Details

#to_sObject



30
31
32
# File 'lib/easy_siconfi/siconfi_data.rb', line 30

def to_s()
	"exercicio: #{@exercicio}\nperiodo: #{@periodo}\nperiodicidade: #{@periodicidade}\ninstituicao: #{@instituicao}\nuf: #{@uf}\npopulacao: #{@populacao}\nrotulo: #{@rotulo}\ncoluna: #{@coluna}\nconta: #{@conta}\nvalor: #{@valor}#{@co_poder != nil ? '\npoder: ' : ''}#{@co_poder != nil ? @co_poder : ''}"
end

#valid?Boolean

rotulo can be null

Returns:

  • (Boolean)


22
23
24
25
26
27
28
# File 'lib/easy_siconfi/siconfi_data.rb', line 22

def valid?()
	@exercicio != nil && @periodo != nil && 
	@periodicidade != nil && @instituicao != nil && 
	@uf != nil && @populacao != nil && 
	@coluna != nil && 
	@conta != nil && @valor != nil 
end