Class: CanTango::Model::Scope::AllowedActions
- Inherits:
-
Object
- Object
- CanTango::Model::Scope::AllowedActions
- Includes:
- Api::User::Ability
- Defined in:
- lib/cantango/model/scope.rb
Instance Attribute Summary collapse
-
#actions ⇒ Object
readonly
Returns the value of attribute actions.
-
#clazz ⇒ Object
readonly
Returns the value of attribute clazz.
-
#mode ⇒ Object
readonly
Returns the value of attribute mode.
Instance Method Summary collapse
- #by_account(account) ⇒ Object
- #by_user(user) ⇒ Object (also: #by)
-
#initialize(clazz, mode, *actions) ⇒ AllowedActions
constructor
A new instance of AllowedActions.
Methods included from Api::User::Ability
#current_user_ability, #user_ability
Methods included from Api::Options
#ability_options, options_list, #options_list
Methods included from Api::Common
Constructor Details
#initialize(clazz, mode, *actions) ⇒ AllowedActions
Returns a new instance of AllowedActions.
19 20 21 22 23 |
# File 'lib/cantango/model/scope.rb', line 19 def initialize clazz, mode, *actions @clazz = clazz @mode = mode @actions = actions.flatten end |
Instance Attribute Details
#actions ⇒ Object (readonly)
Returns the value of attribute actions.
17 18 19 |
# File 'lib/cantango/model/scope.rb', line 17 def actions @actions end |
#clazz ⇒ Object (readonly)
Returns the value of attribute clazz.
17 18 19 |
# File 'lib/cantango/model/scope.rb', line 17 def clazz @clazz end |
#mode ⇒ Object (readonly)
Returns the value of attribute mode.
17 18 19 |
# File 'lib/cantango/model/scope.rb', line 17 def mode @mode end |
Instance Method Details
#by_account(account) ⇒ Object
30 31 32 |
# File 'lib/cantango/model/scope.rb', line 30 def by_account account check account_ability(account) end |
#by_user(user) ⇒ Object Also known as: by
25 26 27 |
# File 'lib/cantango/model/scope.rb', line 25 def by_user user check user_ability(user) end |