Class: Convore::User

Inherits:
Base
  • Object
show all
Defined in:
lib/convore/user.rb

Instance Attribute Summary

Attributes inherited from Base

#attributes, #password, #username

Instance Method Summary collapse

Methods inherited from Base

api, find, from_json, get_class, #method_missing

Constructor Details

#initialize(username, password) ⇒ User

Returns a new instance of User.



4
5
6
7
# File 'lib/convore/user.rb', line 4

def initialize(username, password)
	@username = username
	@password = password
end

Dynamic Method Handling

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

Instance Method Details

#get_info(user_id) ⇒ Object

Get detailed information about the user



10
11
12
13
14
# File 'lib/convore/user.rb', line 10

def get_info(user_id)
	if user_id.integer?
		RestClient.get "https://#{@username}:#{@password}@convore.com/api/users/#{user_id}.json"
	end
end