Class: CanTango::Ability::Mode::Finder
- Inherits:
-
Object
- Object
- CanTango::Ability::Mode::Finder
- Defined in:
- lib/cantango/ability/mode/finder.rb
Instance Attribute Summary collapse
-
#executor ⇒ Object
readonly
Returns the value of attribute executor.
Instance Method Summary collapse
- #class_for(mode) ⇒ Object
- #executor_for(mode) ⇒ Object
-
#initialize(executor) ⇒ Finder
constructor
A new instance of Finder.
Constructor Details
#initialize(executor) ⇒ Finder
Returns a new instance of Finder.
7 8 9 |
# File 'lib/cantango/ability/mode/finder.rb', line 7 def initialize executor @executor = executor end |
Instance Attribute Details
#executor ⇒ Object (readonly)
Returns the value of attribute executor.
3 4 5 |
# File 'lib/cantango/ability/mode/finder.rb', line 3 def executor @executor end |
Instance Method Details
#class_for(mode) ⇒ Object
15 16 17 |
# File 'lib/cantango/ability/mode/finder.rb', line 15 def class_for mode "CanTango::Ability::Mode::#{mode.to_s.camelize}".constantize end |
#executor_for(mode) ⇒ Object
11 12 13 |
# File 'lib/cantango/ability/mode/finder.rb', line 11 def executor_for mode class_for(mode).new ability, end |