Class: ProjetoPesquisa

Inherits:
Object
  • Object
show all
Defined in:
lib/cnpq_ws/projeto_pesquisa.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = []) ⇒ ProjetoPesquisa

Returns a new instance of ProjetoPesquisa.



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/cnpq_ws/projeto_pesquisa.rb', line 11

def initialize(options = [])
	@sequencia_projeto = options[:sequencia_projeto] 
	@ano_inicio = options[:ano_inicio] 
	@ano_fim = options[:ano_fim] 
	@nome_do_projeto = options[:nome_do_projeto] 
	@situacao = options[:situacao] 
	@natureza = options[:natureza] 
	@numero_tecnico_nivel_medio = options[:numero_tecnico_nivel_medio] 
	@numero_graduacao = options[:numero_graduacao] 
	@numero_especializacao = options[:numero_especializacao] 
	@numero_mestrado_academico = options[:numero_mestrado_academico] 
	@numero_mestrado_prof = options[:numero_mestrado_prof] 
	@numero_doutorado = options[:numero_doutorado] 
	@descricao_do_projeto = options[:descricao_do_projeto] 
	@descricao_do_projeto_ingles = options[:descricao_do_projeto_ingles] 
	@nome_do_projeto_ingles = options[:nome_do_projeto_ingles] 
	@flag_potencial_inovacao = options[:flag_potencial_inovacao] 
	@equipe_do_projeto = options[:equipe_do_projeto] 
	@financiadores_do_projeto = options[:financiadores_do_projeto]
end

Instance Attribute Details

#ano_fimObject

Returns the value of attribute ano_fim.



5
6
7
# File 'lib/cnpq_ws/projeto_pesquisa.rb', line 5

def ano_fim
  @ano_fim
end

#ano_inicioObject

Returns the value of attribute ano_inicio.



5
6
7
# File 'lib/cnpq_ws/projeto_pesquisa.rb', line 5

def ano_inicio
  @ano_inicio
end

#descricao_do_projetoObject

Returns the value of attribute descricao_do_projeto.



5
6
7
# File 'lib/cnpq_ws/projeto_pesquisa.rb', line 5

def descricao_do_projeto
  @descricao_do_projeto
end

#descricao_do_projeto_inglesObject

Returns the value of attribute descricao_do_projeto_ingles.



5
6
7
# File 'lib/cnpq_ws/projeto_pesquisa.rb', line 5

def descricao_do_projeto_ingles
  @descricao_do_projeto_ingles
end

#equipe_do_projetoObject

Returns the value of attribute equipe_do_projeto.



5
6
7
# File 'lib/cnpq_ws/projeto_pesquisa.rb', line 5

def equipe_do_projeto
  @equipe_do_projeto
end

#financiadores_do_projetoObject

Returns the value of attribute financiadores_do_projeto.



5
6
7
# File 'lib/cnpq_ws/projeto_pesquisa.rb', line 5

def financiadores_do_projeto
  @financiadores_do_projeto
end

#flag_potencial_inovacaoObject

Returns the value of attribute flag_potencial_inovacao.



5
6
7
# File 'lib/cnpq_ws/projeto_pesquisa.rb', line 5

def flag_potencial_inovacao
  @flag_potencial_inovacao
end

#naturezaObject

Returns the value of attribute natureza.



5
6
7
# File 'lib/cnpq_ws/projeto_pesquisa.rb', line 5

def natureza
  @natureza
end

#nome_do_projetoObject

Returns the value of attribute nome_do_projeto.



5
6
7
# File 'lib/cnpq_ws/projeto_pesquisa.rb', line 5

def nome_do_projeto
  @nome_do_projeto
end

#nome_do_projeto_inglesObject

Returns the value of attribute nome_do_projeto_ingles.



5
6
7
# File 'lib/cnpq_ws/projeto_pesquisa.rb', line 5

def nome_do_projeto_ingles
  @nome_do_projeto_ingles
end

#numero_doutoradoObject

Returns the value of attribute numero_doutorado.



5
6
7
# File 'lib/cnpq_ws/projeto_pesquisa.rb', line 5

def numero_doutorado
  @numero_doutorado
end

#numero_especializacaoObject

Returns the value of attribute numero_especializacao.



5
6
7
# File 'lib/cnpq_ws/projeto_pesquisa.rb', line 5

def numero_especializacao
  @numero_especializacao
end

#numero_graduacaoObject

Returns the value of attribute numero_graduacao.



5
6
7
# File 'lib/cnpq_ws/projeto_pesquisa.rb', line 5

def numero_graduacao
  @numero_graduacao
end

#numero_mestrado_academicoObject

Returns the value of attribute numero_mestrado_academico.



5
6
7
# File 'lib/cnpq_ws/projeto_pesquisa.rb', line 5

def numero_mestrado_academico
  @numero_mestrado_academico
end

#numero_mestrado_profObject

Returns the value of attribute numero_mestrado_prof.



5
6
7
# File 'lib/cnpq_ws/projeto_pesquisa.rb', line 5

def numero_mestrado_prof
  @numero_mestrado_prof
end

#numero_tecnico_nivel_medioObject

Returns the value of attribute numero_tecnico_nivel_medio.



5
6
7
# File 'lib/cnpq_ws/projeto_pesquisa.rb', line 5

def numero_tecnico_nivel_medio
  @numero_tecnico_nivel_medio
end

#sequencia_projetoObject

Returns the value of attribute sequencia_projeto.



5
6
7
# File 'lib/cnpq_ws/projeto_pesquisa.rb', line 5

def sequencia_projeto
  @sequencia_projeto
end

#situacaoObject

Returns the value of attribute situacao.



5
6
7
# File 'lib/cnpq_ws/projeto_pesquisa.rb', line 5

def situacao
  @situacao
end

Instance Method Details

#equipeObject



32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/cnpq_ws/projeto_pesquisa.rb', line 32

def equipe
	e = []
	if self.equipe_do_projeto["INTEGRANTES_DO_PROJETO"].class == Array
		self.equipe_do_projeto.each do |m|
			Hash[*m]["INTEGRANTES_DO_PROJETO"].each do |i|
				e << Membro.new(nome_completo: i["NOME_COMPLETO"], nome_para_citacao: i["NOME_PARA_CITACAO"], ordem_de_integracao: i["ORDEM_DE_INTEGRACAO"], flag_responsavel: i["FLAG_RESPONSAVEL"], nro_id_cnpq: i["NRO_ID_CNPQ"])
			end
		end
	elsif self.equipe_do_projeto["INTEGRANTES_DO_PROJETO"].class == Hash
		i = self.equipe_do_projeto["INTEGRANTES_DO_PROJETO"]
		e << Membro.new(nome_completo: i["NOME_COMPLETO"], nome_para_citacao: i["NOME_PARA_CITACAO"], ordem_de_integracao: i["ORDEM_DE_INTEGRACAO"], flag_responsavel: i["FLAG_RESPONSAVEL"], nro_id_cnpq: i["NRO_ID_CNPQ"])
	end
	e
end

#financiadoresObject



47
48
49
50
51
52
53
54
55
# File 'lib/cnpq_ws/projeto_pesquisa.rb', line 47

def financiadores
	if self.financiadores_do_projeto.try(:any?)
		f = []
		self.financiadores_do_projeto.map{|k,v| v}.flatten.each do |fn|
			f << Financiador.new(sequencia_financiador: fn["SEQUENCIA_FINANCIADOR"], codigo_instituicao: fn["CODIGO_INSTITUICAO"], nome_instituicao: fn["NOME_INSTITUICAO"], natureza: fn["NATUREZA"])
		end
		f
	end
end