Module: CanTango::Api::Model::User

Includes:
Common
Defined in:
lib/cantango/api/model/user.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Methods included from Common

#category, #create_ability

Instance Attribute Details

#ability_class=(value) ⇒ Object (writeonly)

Sets the attribute ability_class

Parameters:

  • value

    the value to set the attribute ability_class to.


4
5
6
# File 'lib/cantango/api/model/user.rb', line 4

def ability_class=(value)
  @ability_class = value
end

#active_accountObject


14
15
16
17
18
# File 'lib/cantango/api/model/user.rb', line 14

def 
  return @active_account if  @active_account
  return send(:account) if respond_to? :account
  raise "No account could be found for user: #{self}"
end

#active_userObject


10
11
12
# File 'lib/cantango/api/model/user.rb', line 10

def active_user
  @active_user || self
end

Class Method Details

.included(clazz) ⇒ Object


6
7
8
# File 'lib/cantango/api/model/user.rb', line 6

def self.included(clazz)
  CanTango.config.users.register_user clazz
end