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.



44
45
46
# File 'app/models/padma_user.rb', line 44

def 
  @cached_current_account
end

Instance Method Details

#current_accountPadmaAccount

Returns:



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

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

#enabled_accountsArray <PadmaAccount>

Returns me enabled accounts as Padma::Account objects

Returns:



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

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

#json_rootObject

Attributes will be sent to server under this key. json_root => { … attributes }



67
68
69
# File 'app/models/padma_user.rb', line 67

def json_root
  :user
end

#padma_accountsArray <PadmaAccount>

Returns my accounts as Padma::Account objects

Returns:



49
50
51
52
# File 'app/models/padma_user.rb', line 49

def padma_accounts
  return nil if self.accounts.nil?
  self.accounts.map{|a|PadmaAccount.new(a)}
end

#verbose_help?Boolean

Returns:

  • (Boolean)


61
62
63
# File 'app/models/padma_user.rb', line 61

def verbose_help?
  !!self.verbose_help
end