Class: Elance::Freelancer

Inherits:
Base
  • Object
show all
Defined in:
lib/elance/freelancer.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

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

GET /contractors/user-id

Yields:

  • (response)


35
36
37
38
39
# File 'lib/elance/freelancer.rb', line 35

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

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

GET /contractors/my

Yields:

  • (response)


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

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

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

GET /contractors

Yields:

  • (response)


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

def search(*params, &block)
  options = {:query => {}}
  options[:query] = params[0] if params.length > 0      
  response = self.class.get "/contractors/#{keywords.join(', ')}", options
  yield(response) if block_given?
  response
end

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

GET /contractors/watchlist

Yields:

  • (response)


26
27
28
29
30
31
32
# File 'lib/elance/freelancer.rb', line 26

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