Class: Watch
- Inherits:
-
Object
- Object
- Watch
- Defined in:
- lib/watch.rb
Instance Method Summary collapse
-
#initialize(glob, prefire: true, wait: 0.5, &block) ⇒ Watch
constructor
A new instance of Watch.
Constructor Details
#initialize(glob, prefire: true, wait: 0.5, &block) ⇒ Watch
Returns a new instance of Watch.
2 3 4 5 6 7 8 9 10 11 12 13 |
# File 'lib/watch.rb', line 2 def initialize(glob, prefire: true, wait: 0.5, &block) raise "must pass a block" unless block_given? @glob = glob @wait = wait @block = block snapshot! @block.call if prefire run_loop end |