Class: WebMinion::CycleChecker

Inherits:
Object
  • Object
show all
Defined in:
lib/web_minion/cycle_checker.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#actionsObject

Returns the value of attribute actions.



3
4
5
# File 'lib/web_minion/cycle_checker.rb', line 3

def actions
  @actions
end

#checkedObject

Returns the value of attribute checked.



3
4
5
# File 'lib/web_minion/cycle_checker.rb', line 3

def checked
  @checked
end

#cyclicalObject

Returns the value of attribute cyclical.



3
4
5
# File 'lib/web_minion/cycle_checker.rb', line 3

def cyclical
  @cyclical
end

#on_stackObject

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_actionObject

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

Returns:

  • (Boolean)


13
14
15
# File 'lib/web_minion/cycle_checker.rb', line 13

def cycle?
  @cyclical && !@cyclical.nil?
end