Class: SitePrism::Timer Private

Inherits:
Object
  • Object
show all
Defined in:
lib/site_prism/timer.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(wait_time) ⇒ Timer

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Timer.



14
15
16
17
# File 'lib/site_prism/timer.rb', line 14

def initialize(wait_time)
  @wait_time = wait_time
  @done = false
end

Instance Attribute Details

#wait_timeObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



8
9
10
# File 'lib/site_prism/timer.rb', line 8

def wait_time
  @wait_time
end

Class Method Details

.run(wait_time, &block) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



10
11
12
# File 'lib/site_prism/timer.rb', line 10

def self.run(wait_time, &block)
  new(wait_time).run(&block)
end

Instance Method Details

#done?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


19
20
21
# File 'lib/site_prism/timer.rb', line 19

def done?
  @done == true
end

#runObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



23
24
25
26
27
28
# File 'lib/site_prism/timer.rb', line 23

def run
  start
  yield self
ensure
  stop
end