Class: PadmaUser
- Inherits:
-
LogicalModel
- Object
- LogicalModel
- PadmaUser
- Defined in:
- app/models/padma_user.rb
Constant Summary collapse
- TIMEOUT =
milisecons
5500
- PER_PAGE =
9999
Instance Method Summary collapse
-
#enabled_accounts ⇒ Array <PadmaAccount>
Returns me enabled accounts as Padma::Account objects.
-
#id ⇒ Object
LogicalModel expects an id to create resource_uri.
-
#padma_accounts ⇒ Array <PadmaAccount>
Returns my accounts as Padma::Account objects.
- #verbose_help? ⇒ Boolean
Instance Method Details
#enabled_accounts ⇒ Array <PadmaAccount>
Returns me enabled accounts as Padma::Account objects
35 36 37 38 |
# File 'app/models/padma_user.rb', line 35 def enabled_accounts return [] if self.accounts.nil? self.accounts.reject{|a|!a['enabled']}.map{|a|PadmaAccount.new(a)} end |
#id ⇒ Object
LogicalModel expects an id to create resource_uri
23 24 25 |
# File 'app/models/padma_user.rb', line 23 def id self.username end |
#padma_accounts ⇒ Array <PadmaAccount>
Returns my accounts as Padma::Account objects
29 30 31 |
# File 'app/models/padma_user.rb', line 29 def padma_accounts self.accounts.map{|a|PadmaAccount.new(a)} end |
#verbose_help? ⇒ Boolean
40 41 42 |
# File 'app/models/padma_user.rb', line 40 def verbose_help? !!self.verbose_help end |