Class: Elance::Job

Inherits:
Base
  • Object
show all
Defined in:
lib/elance/job.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize, #method_missing

Constructor Details

This class inherits a constructor from Elance::Base

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Elance::Base

Instance Method Details

#all(*params) {|response| ... } ⇒ Object

GET /jobs

Yields:

  • (response)


8
9
10
11
12
13
14
# File 'lib/elance/job.rb', line 8

def all(*params, &block)
  options = {:query => {}}
  options[:query] = params[0] if params.length > 0
  response = self.class.get '/jobs', options
  yield(response) if block_given?
  response
end

#find(job_id) {|response| ... } ⇒ Object

GET /job/job-id

Yields:

  • (response)


26
27
28
29
30
# File 'lib/elance/job.rb', line 26

def find(job_id, &block)
  response = self.class.get "/jobs/#{job_id}", options
  yield(response) if block_given?
  response
end

#my(*params) {|response| ... } ⇒ Object

GET /jobs/my

Yields:

  • (response)


17
18
19
20
21
22
23
# File 'lib/elance/job.rb', line 17

def my(*params, &block)
  options = {:query => {}}
  options[:query] = params[0] if params.length > 0
  response = self.class.get '/jobs/my', options
  yield(response) if block_given?
  response
end

#proposals(job_id) {|response| ... } ⇒ Object

GET /job/job-id/proposals

Yields:

  • (response)


33
34
35
36
37
# File 'lib/elance/job.rb', line 33

def proposals(job_id, &block)
  response = self.class.get "/jobs/#{job_id}/proposals", options
  yield(response) if block_given?
  response
end