Class: GetAFreelancer::Client
- Inherits:
-
Object
- Object
- GetAFreelancer::Client
- Includes:
- HTTParty
- Defined in:
- lib/getafreelancer.rb
Instance Method Summary collapse
- #get(path, options = {}) ⇒ Object
-
#initialize(api_key = '') ⇒ Client
constructor
A new instance of Client.
- #user(user_id_or_slug = "") ⇒ Object
Constructor Details
#initialize(api_key = '') ⇒ 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, ={}) self.class.get("#{path}", ) end |
#user(user_id_or_slug = "") ⇒ Object
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 |