Class: PadmaUser
- Inherits:
-
LogicalModel
- Object
- LogicalModel
- PadmaUser
- Includes:
- Gravtastic
- Defined in:
- app/models/padma_user.rb
Constant Summary collapse
- TIMEOUT =
milisecons
5500
- PER_PAGE =
9999
Instance Attribute Summary collapse
-
#cached_current_account ⇒ Object
Returns the value of attribute cached_current_account.
Instance Method Summary collapse
- #current_account ⇒ PadmaAccount
-
#enabled_accounts ⇒ Array <PadmaAccount>
Returns me enabled accounts as Padma::Account objects.
-
#padma_accounts ⇒ Array <PadmaAccount>
Returns my accounts as Padma::Account objects.
- #verbose_help? ⇒ Boolean
Instance Attribute Details
#cached_current_account ⇒ Object
Returns the value of attribute cached_current_account.
40 41 42 |
# File 'app/models/padma_user.rb', line 40 def cached_current_account @cached_current_account end |
Instance Method Details
#current_account ⇒ PadmaAccount
32 33 34 35 36 37 38 39 |
# File 'app/models/padma_user.rb', line 32 def current_account unless cached_current_account if self.current_account_name self.cached_current_account= PadmaAccount.find(self.current_account_name) end end cached_current_account end |
#enabled_accounts ⇒ Array <PadmaAccount>
Returns me enabled accounts as Padma::Account objects
51 52 53 54 |
# File 'app/models/padma_user.rb', line 51 def enabled_accounts return [] if self.accounts.nil? self.accounts.reject{|a|!a['enabled']}.map{|a|PadmaAccount.new(a)} end |
#padma_accounts ⇒ Array <PadmaAccount>
Returns my accounts as Padma::Account objects
45 46 47 |
# File 'app/models/padma_user.rb', line 45 def padma_accounts self.accounts.map{|a|PadmaAccount.new(a)} end |
#verbose_help? ⇒ Boolean
56 57 58 |
# File 'app/models/padma_user.rb', line 56 def verbose_help? !!self.verbose_help end |