Class: Elance::Profile

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

#name_id(name_or_id) {|response| ... } ⇒ Object

GET profiles/name-or-id

Yields:

  • (response)


22
23
24
25
26
# File 'lib/elance/profile.rb', line 22

def name_id(name_or_id, &block)
  response = self.class.get "/profiles/#{name_or_id}"
  yield(response) if block_given?
  response
end

#name_id_icon(name_or_id) {|response| ... } ⇒ Object

GET profiles/name-or-id/icon

Yields:

  • (response)


29
30
31
32
33
# File 'lib/elance/profile.rb', line 29

def name_id_icon(name_or_id, &block)
  response = self.class.get "/profiles/#{name_or_id}/icon"
  yield(response) if block_given?
  response
end

#profile {|response| ... } ⇒ Object

GET /profiles/my

Yields:

  • (response)


8
9
10
11
12
# File 'lib/elance/profile.rb', line 8

def profile(&block)
  response = self.class.get "/profiles/my"
  yield(response) if block_given?
  response
end

#profile_icon {|response| ... } ⇒ Object

GET /profiles/my/icon

Yields:

  • (response)


15
16
17
18
19
# File 'lib/elance/profile.rb', line 15

def profile_icon(&block)
  response = self.class.get "/profiles/my/icon"
  yield(response) if block_given?
  response
end