Class: Broach::User
Overview
Represents a user on the server
Class Method Summary collapse
-
.find(id) ⇒ Object
Returns a User instance for a user with a specific ID.
-
.me ⇒ Object
Returns a User instance for the currently authenticated user.
Methods included from Attributes
#id, #initialize, #method_missing
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Broach::Attributes
Class Method Details
.find(id) ⇒ Object
Returns a User instance for a user with a specific ID
12 13 14 |
# File 'lib/broach/user.rb', line 12 def self.find(id) new(Broach.session.get("users/#{id.to_i}")['user']) end |
.me ⇒ Object
Returns a User instance for the currently authenticated user
7 8 9 |
# File 'lib/broach/user.rb', line 7 def self.me new(Broach.session.get('users/me')['user']) end |