Class: Broach::User

Inherits:
Object
  • Object
show all
Includes:
Attributes
Defined in:
lib/broach/user.rb

Overview

Represents a user on the server

Class Method Summary collapse

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

.meObject

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