Class: PadmaUser

Inherits:
LogicalModel
  • Object
show all
Includes:
Gravtastic
Defined in:
app/models/padma_user.rb

Constant Summary collapse

TIMEOUT =

milisecons

5500
PER_PAGE =
9999

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#cached_current_accountObject

Returns the value of attribute cached_current_account.



42
43
44
# File 'app/models/padma_user.rb', line 42

def 
  @cached_current_account
end

Instance Method Details

#current_accountPadmaAccount

Returns:



34
35
36
37
38
39
40
41
# File 'app/models/padma_user.rb', line 34

def 
  unless 
    if self.
      self.= PadmaAccount.find(self.)
    end
  end
  
end

#enabled_accountsArray <PadmaAccount>

Returns me enabled accounts as Padma::Account objects

Returns:



53
54
55
56
# File 'app/models/padma_user.rb', line 53

def enabled_accounts
  return [] if self.accounts.nil?
  self.accounts.reject{|a|!a['enabled']}.map{|a|PadmaAccount.new(a)}
end

#idObject

LogicalModel expects an id to create resource_uri



29
30
31
# File 'app/models/padma_user.rb', line 29

def id
  self.username
end

#padma_accountsArray <PadmaAccount>

Returns my accounts as Padma::Account objects

Returns:



47
48
49
# File 'app/models/padma_user.rb', line 47

def padma_accounts
  self.accounts.map{|a|PadmaAccount.new(a)}
end

#verbose_help?Boolean

Returns:

  • (Boolean)


58
59
60
# File 'app/models/padma_user.rb', line 58

def verbose_help?
  !!self.verbose_help
end