Class: Odesk::Api::Routers::Hr::Jobs

Inherits:
Object
  • Object
show all
Defined in:
lib/odesk/api/routers/hr/jobs.rb

Overview

Jobs API

Constant Summary collapse

ENTRY_POINT =
'api'

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Jobs

Init

Arguments:

client: (Client)


26
27
28
29
# File 'lib/odesk/api/routers/hr/jobs.rb', line 26

def initialize(client)
  @client = client
  @client.epoint = ENTRY_POINT 
end

Instance Method Details

#delete_job(key, params) ⇒ Object

Delete existent job

Arguments:

params: (Hash)


71
72
73
74
# File 'lib/odesk/api/routers/hr/jobs.rb', line 71

def delete_job(key, params)
  $LOG.i "running " + __method__.to_s
  @client.delete '/hr/v2/jobs/' + key, params
end

#edit_job(key, params) ⇒ Object

Edit existent job

Arguments:

params: (Hash)


62
63
64
65
# File 'lib/odesk/api/routers/hr/jobs.rb', line 62

def edit_job(key, params)
  $LOG.i "running " + __method__.to_s
  @client.put '/hr/v2/jobs/' + key, params
end

#get_list(params) ⇒ Object

Get list of jobs

Arguments:

params: (Hash)


35
36
37
38
# File 'lib/odesk/api/routers/hr/jobs.rb', line 35

def get_list(params)
  $LOG.i "running " + __method__.to_s
  @client.get '/hr/v2/jobs', params
end

#get_specific(key) ⇒ Object

Get specific job by key

Arguments:

key: (String)


44
45
46
47
# File 'lib/odesk/api/routers/hr/jobs.rb', line 44

def get_specific(key)
  $LOG.i "running " + __method__.to_s
  @client.get '/hr/v2/jobs/' + key
end

#post_job(params) ⇒ Object

Post a new job

Arguments:

params: (Hash)


53
54
55
56
# File 'lib/odesk/api/routers/hr/jobs.rb', line 53

def post_job(params)
  $LOG.i "running " + __method__.to_s
  @client.post '/hr/v2/jobs', params
end