Class: GetAFreelancer::Client

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/getafreelancer.rb

Instance Method Summary collapse

Constructor Details

#initialize(api_key = '') ⇒ Client

Returns a new instance of Client.



12
13
14
# File 'lib/getafreelancer.rb', line 12

def initialize(api_key='')
  self.class.default_params :apikey => api_key unless api_key.blank?
end

Instance Method Details

#get(path, options = {}) ⇒ Object



16
17
18
# File 'lib/getafreelancer.rb', line 16

def get(path, options={})
  self.class.get("#{path}", options)
end

#user(user_id_or_slug = "") ⇒ Object

Raises:

  • (ArgumentError)


20
21
22
23
# File 'lib/getafreelancer.rb', line 20

def user(user_id_or_slug="")
  raise ArgumentError, 'You must specify a User id or slug' if user_id_or_slug.blank?
  User.new(self, user_id_or_slug)
end