Module: CanTango::Api::Model::Account
- Includes:
- Common
- Defined in:
- lib/cantango/api/model/account.rb
Instance Attribute Summary collapse
Class Method Summary
collapse
Methods included from Common
#category, #create_ability
Instance Attribute Details
#ability_class=(value) ⇒ Object
Sets the attribute ability_class
4
5
6
|
# File 'lib/cantango/api/model/account.rb', line 4
def ability_class=(value)
@ability_class = value
end
|
#active_account ⇒ Object
16
17
18
|
# File 'lib/cantango/api/model/account.rb', line 16
def active_account
@active_account || self
end
|
#active_user ⇒ Object
10
11
12
13
14
|
# File 'lib/cantango/api/model/account.rb', line 10
def active_user
return @active_user if @active_user
return send(:user) if respond_to? :user
raise "No user could be found for account: #{self}"
end
|
Class Method Details
.included(clazz) ⇒ Object
6
7
8
|
# File 'lib/cantango/api/model/account.rb', line 6
def self.included(clazz)
CanTango.config.accounts.register_account clazz
end
|