Class: Lhm::Throttler::Time
- Inherits:
-
Object
- Object
- Lhm::Throttler::Time
- Includes:
- Command
- Defined in:
- lib/lhm/throttler/time.rb
Direct Known Subclasses
Constant Summary collapse
- DEFAULT_TIMEOUT =
0.1
- DEFAULT_STRIDE =
40_000
Instance Attribute Summary collapse
-
#stride ⇒ Object
Returns the value of attribute stride.
-
#timeout_seconds ⇒ Object
Returns the value of attribute timeout_seconds.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(options = {}) ⇒ Time
constructor
A new instance of Time.
Methods included from Command
Constructor Details
#initialize(options = {}) ⇒ Time
Returns a new instance of Time.
12 13 14 15 |
# File 'lib/lhm/throttler/time.rb', line 12 def initialize( = {}) @timeout_seconds = [:delay] || DEFAULT_TIMEOUT @stride = [:stride] || DEFAULT_STRIDE end |
Instance Attribute Details
#stride ⇒ Object
Returns the value of attribute stride.
10 11 12 |
# File 'lib/lhm/throttler/time.rb', line 10 def stride @stride end |
#timeout_seconds ⇒ Object
Returns the value of attribute timeout_seconds.
9 10 11 |
# File 'lib/lhm/throttler/time.rb', line 9 def timeout_seconds @timeout_seconds end |
Instance Method Details
#execute ⇒ Object
17 18 19 |
# File 'lib/lhm/throttler/time.rb', line 17 def execute sleep timeout_seconds end |