Module: FirstjobApi

Includes:
HTTParty
Defined in:
lib/firstjob_api.rb,
lib/firstjob_api/career.rb,
lib/firstjob_api/version.rb,
lib/firstjob_api/university.rb,
lib/firstjob_api/excel_level.rb,
lib/firstjob_api/http_parser.rb,
lib/firstjob_api/looking_for.rb,
lib/firstjob_api/publication.rb,
lib/firstjob_api/career_status.rb,
lib/firstjob_api/english_level.rb

Defined Under Namespace

Classes: Career, CareerStatus, EnglishLevel, ExcelLevel, HttpParser, LookingFor, Publication, University

Constant Summary collapse

VERSION =
"1.0.9"
@@grant_type =
"password"
@@client_id =
nil
@@username =
nil
@@email =
nil
@@password =
nil
@@access_token =
nil
@@token_type =
nil
@@expires_in =
nil
@@access_token_updated_at =
nil
@@options =
nil
@@body =
nil
@@last_request =
nil
@@last_response =
nil
@@try_counter =
0

Class Method Summary collapse

Class Method Details

.publish(params) ⇒ Object

Publicaciones creates and publish a publication



72
73
74
75
# File 'lib/firstjob_api.rb', line 72

def self.publish(params)
  publication = FirstjobApi::Publication.create(params)
  return publication
end

.setup {|_self| ... } ⇒ Object

Default way to setup FirstjobApi.

Yields:

  • (_self)

Yield Parameters:

  • _self (FirstjobApi)

    the object that the method was called on



62
63
64
65
66
67
68
# File 'lib/firstjob_api.rb', line 62

def self.setup
  yield self
  # It does not use basic http auth, it passes the username and password in the body of the request...
  #@@options = {headers: { "Accept" => "application/json", "Content-Type" => "application/json"}, basic_auth: {username: @@username, password: @@password}}
  @@options = {headers: { "Accept" => "application/json", "Content-Type" => "application/json"}}
  @@body = {username: @@username, password: @@password}
end