Class: Waiting::Waiter

Inherits:
Object
  • Object
show all
Defined in:
lib/waiting/waiter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeWaiter

Waiter is in waiting state to start with



9
10
11
# File 'lib/waiting/waiter.rb', line 9

def initialize
  @done = false
end

Instance Attribute Details

#attemptsObject

Returns the value of attribute attempts.



3
4
5
# File 'lib/waiting/waiter.rb', line 3

def attempts
  @attempts
end

#exp_baseObject

Returns the value of attribute exp_base.



4
5
6
# File 'lib/waiting/waiter.rb', line 4

def exp_base
  @exp_base
end

#intervalObject

Returns the value of attribute interval.



5
6
7
# File 'lib/waiting/waiter.rb', line 5

def interval
  @interval
end

#max_attemptsObject

Returns the value of attribute max_attempts.



6
7
8
# File 'lib/waiting/waiter.rb', line 6

def max_attempts
  @max_attempts
end

Instance Method Details

#doneObject

Mark the waiter as done



14
15
16
# File 'lib/waiting/waiter.rb', line 14

def done
  @done = true
end

#done?Boolean

Is the waiter done?

Returns:

  • (Boolean)

    if the waiter is done



20
21
22
# File 'lib/waiting/waiter.rb', line 20

def done?
  @done
end