Class: Greenjaguar::Strategies::RandomStrategy
- Inherits:
-
WaitStrategy
- Object
- WaitStrategy
- Greenjaguar::Strategies::RandomStrategy
- Defined in:
- lib/greenjaguar/strategies/random_strategy.rb
Instance Attribute Summary
Attributes inherited from WaitStrategy
Instance Method Summary collapse
-
#initialize ⇒ RandomStrategy
constructor
A new instance of RandomStrategy.
- #reset_vars ⇒ Object
- #wait ⇒ Object
Methods inherited from WaitStrategy
Constructor Details
#initialize ⇒ RandomStrategy
Returns a new instance of RandomStrategy.
4 5 6 7 |
# File 'lib/greenjaguar/strategies/random_strategy.rb', line 4 def initialize super @time_to_wait = 5 end |
Instance Method Details
#reset_vars ⇒ Object
9 10 11 |
# File 'lib/greenjaguar/strategies/random_strategy.rb', line 9 def reset_vars @time_to_wait = 5 * convert_to(time_unit) end |
#wait ⇒ Object
13 14 15 |
# File 'lib/greenjaguar/strategies/random_strategy.rb', line 13 def wait rand(@time_to_wait) end |