Class: CanTango::Ability::Mode::Finder

Inherits:
Object
  • Object
show all
Defined in:
lib/cantango/ability/mode/finder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#executorObject (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, options
end