Class: CanTango::Ability::Executor::Base
- Includes:
- Builder, Callbacks, CanTango::Ability::Executor
- Defined in:
- lib/cantango/ability/executor/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#ability ⇒ Object
readonly
Returns the value of attribute ability.
-
#executed ⇒ Object
readonly
Returns the value of attribute executed.
-
#modes ⇒ Object
readonly
Returns the value of attribute modes.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Attributes included from Helpers::Debug
Attributes inherited from Base
Instance Method Summary collapse
- #calculate_rules ⇒ Object
-
#executed? ⇒ Boolean
def self.inherited(base) base.send :include, CanTango::Helpers::Debug base.send :include, CanTango::Ability::Executor base.send :include, CanTango::Ability::Rules base.send :include, CanTango::Ability::Callbacks end.
-
#initialize(ability, options = {}) ⇒ Base
constructor
A new instance of Base.
Methods included from Builder
Methods included from Callbacks
#handle_callbacks, included, #within_callbacks
Methods included from Helpers::Debug
Methods included from CanTango::Ability::Executor
Methods included from Rules
#clear_rules!, #default_rules, #normalize_rules!, #rules
Methods inherited from Base
Constructor Details
#initialize(ability, options = {}) ⇒ Base
Returns a new instance of Base.
11 12 13 14 15 16 17 |
# File 'lib/cantango/ability/executor/base.rb', line 11 def initialize ability, = {} raise ArgumentError, "Ability must be something!" if !ability raise ArgumentError, "Ability must be a kind of CanTango::Ability::Base" if !ability.kind_of?(CanTango::Ability::Base) raise ArgumentError, "Options must be a hash" if !.kind_of?(Hash) @ability = ability @options ||= end |
Instance Attribute Details
#ability ⇒ Object (readonly)
Returns the value of attribute ability.
7 8 9 |
# File 'lib/cantango/ability/executor/base.rb', line 7 def ability @ability end |
#executed ⇒ Object (readonly)
Returns the value of attribute executed.
7 8 9 |
# File 'lib/cantango/ability/executor/base.rb', line 7 def executed @executed end |
#modes ⇒ Object (readonly)
Returns the value of attribute modes.
7 8 9 |
# File 'lib/cantango/ability/executor/base.rb', line 7 def modes @modes end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
7 8 9 |
# File 'lib/cantango/ability/executor/base.rb', line 7 def @options end |
Instance Method Details
#calculate_rules ⇒ Object
30 31 32 |
# File 'lib/cantango/ability/executor/base.rb', line 30 def calculate_rules super end |
#executed? ⇒ Boolean
26 27 28 |
# File 'lib/cantango/ability/executor/base.rb', line 26 def executed? @executed end |