Class: Failbot::WaiterBackend
- Inherits:
-
Object
- Object
- Failbot::WaiterBackend
- Defined in:
- lib/failbot/waiter_backend.rb
Instance Attribute Summary collapse
-
#reports ⇒ Object
readonly
This backend waits a configured amount of time before returning.
Instance Method Summary collapse
-
#initialize(delay = 5) ⇒ WaiterBackend
constructor
A new instance of WaiterBackend.
- #ping ⇒ Object
- #report(data) ⇒ Object
Constructor Details
#initialize(delay = 5) ⇒ WaiterBackend
Returns a new instance of WaiterBackend.
7 8 9 10 |
# File 'lib/failbot/waiter_backend.rb', line 7 def initialize(delay = 5) @delay = delay @reports = [] end |
Instance Attribute Details
#reports ⇒ Object (readonly)
This backend waits a configured amount of time before returning. This is intended be used to test timeouts. Delay is the number of seconds to wait.
6 7 8 |
# File 'lib/failbot/waiter_backend.rb', line 6 def reports @reports end |
Instance Method Details
#ping ⇒ Object
17 18 19 |
# File 'lib/failbot/waiter_backend.rb', line 17 def ping # nop end |
#report(data) ⇒ Object
12 13 14 15 |
# File 'lib/failbot/waiter_backend.rb', line 12 def report(data) @reports << data sleep(@delay) end |