Class: WebMinion::CycleChecker
- Inherits:
-
Object
- Object
- WebMinion::CycleChecker
- Defined in:
- lib/web_minion/cycle_checker.rb
Instance Attribute Summary collapse
-
#actions ⇒ Object
Returns the value of attribute actions.
-
#checked ⇒ Object
Returns the value of attribute checked.
-
#cyclical ⇒ Object
Returns the value of attribute cyclical.
-
#on_stack ⇒ Object
Returns the value of attribute on_stack.
-
#starting_action ⇒ Object
Returns the value of attribute starting_action.
Instance Method Summary collapse
- #cycle? ⇒ Boolean
-
#initialize(starting_action) ⇒ CycleChecker
constructor
A new instance of CycleChecker.
Constructor Details
#initialize(starting_action) ⇒ CycleChecker
Returns a new instance of CycleChecker.
5 6 7 8 9 10 11 |
# File 'lib/web_minion/cycle_checker.rb', line 5 def initialize(starting_action) @checked = [] @on_stack = [] @starting_action = starting_action @cyclical = false check_for_cycle(starting_action) end |
Instance Attribute Details
#actions ⇒ Object
Returns the value of attribute actions.
3 4 5 |
# File 'lib/web_minion/cycle_checker.rb', line 3 def actions @actions end |
#checked ⇒ Object
Returns the value of attribute checked.
3 4 5 |
# File 'lib/web_minion/cycle_checker.rb', line 3 def checked @checked end |
#cyclical ⇒ Object
Returns the value of attribute cyclical.
3 4 5 |
# File 'lib/web_minion/cycle_checker.rb', line 3 def cyclical @cyclical end |
#on_stack ⇒ Object
Returns the value of attribute on_stack.
3 4 5 |
# File 'lib/web_minion/cycle_checker.rb', line 3 def on_stack @on_stack end |
#starting_action ⇒ Object
Returns the value of attribute starting_action.
3 4 5 |
# File 'lib/web_minion/cycle_checker.rb', line 3 def starting_action @starting_action end |
Instance Method Details
#cycle? ⇒ Boolean
13 14 15 |
# File 'lib/web_minion/cycle_checker.rb', line 13 def cycle? @cyclical && !@cyclical.nil? end |