Class: Clubhouse::User

Inherits:
BaseResource show all
Defined in:
lib/clubhouse/user.rb

Defined Under Namespace

Classes: Permission

Instance Attribute Summary

Attributes inherited from BaseResource

#client

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseResource

all, attributes, attributes_for_create, attributes_for_update, client, find, #initialize, #reload, resource, #update_object_from_payload

Constructor Details

This class inherits a constructor from Clubhouse::BaseResource

Class Method Details

.delete(id = nil) ⇒ Object



15
16
17
# File 'lib/clubhouse/user.rb', line 15

def self.delete(id = nil)
  raise NotSupportedByAPIError, "You can't delete users over the API, please use clubhouse web"
end

Instance Method Details

#permissionsObject



19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/clubhouse/user.rb', line 19

def permissions
  @_permissions ||= Array(@permissions).collect do |p|
    Permission.new(
      p['created_at'],
      p['disabled'],
      p['email_address'],
      p['gravatar_hash'],
      p['id'],
      p['initials'],
      p['role'],
      p['updated_at']
    )
  end
end

#saveObject



11
12
13
# File 'lib/clubhouse/user.rb', line 11

def save
  raise NotSupportedByAPIError, "You can't create users over the API, please use clubhouse web"
end