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 (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/account.rb', line 4

def ability_class=(value)
  @ability_class = value
end

#active_accountObject



16
17
18
# File 'lib/cantango/api/model/account.rb', line 16

def 
  @active_account || self
end

#active_userObject



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. clazz
end