Class: Humidifier::Sleeper

Inherits:
Object
  • Object
show all
Defined in:
lib/humidifier/sleeper.rb

Overview

Manages waiting for stack events for v1 of the SDK

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attempts, &block) ⇒ Sleeper

Store attempts and wait for the block to return true



9
10
11
12
# File 'lib/humidifier/sleeper.rb', line 9

def initialize(attempts, &block)
  @attempts = attempts
  hibernate_until(&block)
end

Instance Attribute Details

#attemptsObject (readonly)

Returns the value of attribute attempts.



6
7
8
# File 'lib/humidifier/sleeper.rb', line 6

def attempts
  @attempts
end