Class: SICONFIData
- Inherits:
-
Object
- Object
- SICONFIData
- Defined in:
- lib/easy_siconfi/siconfi_data.rb
Instance Attribute Summary collapse
-
#co_poder ⇒ Object
Returns the value of attribute co_poder.
-
#coluna ⇒ Object
Returns the value of attribute coluna.
-
#conta ⇒ Object
Returns the value of attribute conta.
-
#exercicio ⇒ Object
Returns the value of attribute exercicio.
-
#instituicao ⇒ Object
Returns the value of attribute instituicao.
-
#periodicidade ⇒ Object
Returns the value of attribute periodicidade.
-
#periodo ⇒ Object
Returns the value of attribute periodo.
-
#populacao ⇒ Object
Returns the value of attribute populacao.
-
#rotulo ⇒ Object
Returns the value of attribute rotulo.
-
#uf ⇒ Object
Returns the value of attribute uf.
-
#valor ⇒ Object
Returns the value of attribute valor.
Instance Method Summary collapse
-
#initialize(hash) ⇒ SICONFIData
constructor
A new instance of SICONFIData.
- #to_s ⇒ Object
-
#valid? ⇒ Boolean
rotulo can be null.
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_poder ⇒ Object
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 |
#coluna ⇒ Object
Returns the value of attribute coluna.
2 3 4 |
# File 'lib/easy_siconfi/siconfi_data.rb', line 2 def coluna @coluna end |
#conta ⇒ Object
Returns the value of attribute conta.
2 3 4 |
# File 'lib/easy_siconfi/siconfi_data.rb', line 2 def conta @conta end |
#exercicio ⇒ Object
Returns the value of attribute exercicio.
2 3 4 |
# File 'lib/easy_siconfi/siconfi_data.rb', line 2 def exercicio @exercicio end |
#instituicao ⇒ Object
Returns the value of attribute instituicao.
2 3 4 |
# File 'lib/easy_siconfi/siconfi_data.rb', line 2 def instituicao @instituicao end |
#periodicidade ⇒ Object
Returns the value of attribute periodicidade.
2 3 4 |
# File 'lib/easy_siconfi/siconfi_data.rb', line 2 def periodicidade @periodicidade end |
#periodo ⇒ Object
Returns the value of attribute periodo.
2 3 4 |
# File 'lib/easy_siconfi/siconfi_data.rb', line 2 def periodo @periodo end |
#populacao ⇒ Object
Returns the value of attribute populacao.
2 3 4 |
# File 'lib/easy_siconfi/siconfi_data.rb', line 2 def populacao @populacao end |
#rotulo ⇒ Object
Returns the value of attribute rotulo.
2 3 4 |
# File 'lib/easy_siconfi/siconfi_data.rb', line 2 def rotulo @rotulo end |
#uf ⇒ Object
Returns the value of attribute uf.
2 3 4 |
# File 'lib/easy_siconfi/siconfi_data.rb', line 2 def uf @uf end |
#valor ⇒ Object
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_s ⇒ Object
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
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 |