Class: Odesk::Api::Routers::Hr::Contracts

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

Overview

Contracts API

Constant Summary collapse

ENTRY_POINT =
'api'

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Contracts

Init

Arguments:

client: (Client)


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

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

Instance Method Details

#end_contract(reference, params) ⇒ Object

End Contract

Arguments:

reference: (String)
params: (Hash)


56
57
58
59
# File 'lib/odesk/api/routers/hr/contracts.rb', line 56

def end_contract(reference, params)
  $LOG.i "running " + __method__.to_s
  @client.delete '/hr/v2/contracts/' + reference, params
end

#restart_contract(reference, params) ⇒ Object

Restart Contract

Arguments:

reference: (String)
params: (Hash)


46
47
48
49
# File 'lib/odesk/api/routers/hr/contracts.rb', line 46

def restart_contract(reference, params)
  $LOG.i "running " + __method__.to_s
  @client.put '/hr/v2/contracts/' + reference + '/restart', params
end

#suspend_contract(reference, params) ⇒ Object

Suspend Contract

Arguments:

reference: (String)
params: (Hash)


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

def suspend_contract(reference, params)
  $LOG.i "running " + __method__.to_s
  @client.put '/hr/v2/contracts/' + reference + '/suspend', params
end