Class: CanTango::Engine
Instance Attribute Summary collapse
#debug_writer, #do_debug
Instance Method Summary
collapse
#debug, #debug?, included
Constructor Details
#initialize(ability, options = {}) ⇒ Engine
Returns a new instance of Engine.
9
10
11
|
# File 'lib/cantango/engine.rb', line 9
def initialize ability, options = {}
@ability, @options = [ability, options]
end
|
Instance Attribute Details
#ability ⇒ Object
Returns the value of attribute ability.
5
6
7
|
# File 'lib/cantango/engine.rb', line 5
def ability
@ability
end
|
#options ⇒ Object
Returns the value of attribute options.
5
6
7
|
# File 'lib/cantango/engine.rb', line 5
def options
@options
end
|
Instance Method Details
#engine_name ⇒ Object
17
18
19
|
# File 'lib/cantango/engine.rb', line 17
def engine_name
raise NotImplementedError
end
|
#execute! ⇒ Object
13
14
15
|
# File 'lib/cantango/engine.rb', line 13
def execute!
raise NotImplementedError
end
|
#modes ⇒ Object
25
26
27
|
# File 'lib/cantango/engine.rb', line 25
def modes
@modes ||= options[:modes] || []
end
|
#valid_mode?(mode) ⇒ Boolean
21
22
23
|
# File 'lib/cantango/engine.rb', line 21
def valid_mode? mode
modes.include? mode.to_sym
end
|