Class: LattesApi::Api

Inherits:
Object
  • Object
show all
Defined in:
lib/lattes_api/api.rb

Instance Method Summary collapse

Constructor Details

#initializeApi

Returns a new instance of Api.



5
6
7
# File 'lib/lattes_api/api.rb', line 5

def initialize
  @client = Savon.client(wsdl: wsdl, endpoint: endpoint)
end

Instance Method Details

#get_curriculo_compactado(id_cnpq) ⇒ Object



16
17
18
19
20
21
# File 'lib/lattes_api/api.rb', line 16

def get_curriculo_compactado(id_cnpq)
  response = @client.call(
    :get_curriculo_compactado, message: { id: id_cnpq })
  result = response.body[:get_curriculo_compactado_response][:return]
  fail_or_return result
end

#get_identificador_cnpq(cpf) ⇒ Object



9
10
11
12
13
14
# File 'lib/lattes_api/api.rb', line 9

def get_identificador_cnpq(cpf)
  response = @client.call(:get_identificador_cn_pq, message: { cpf: cpf,
    nomeCompleto: nil, dataNascimento: nil })
  result = response.body[:get_identificador_cn_pq_response][:return]
  fail_or_return result
end