Class: Lmkplz::Repeatedly
- Inherits:
-
Object
- Object
- Lmkplz::Repeatedly
- Defined in:
- lib/lmkplz/repeatedly.rb
Instance Attribute Summary collapse
-
#callbacker ⇒ Object
readonly
Returns the value of attribute callbacker.
Instance Method Summary collapse
-
#initialize(*paths, only: nil, except: nil, &block) ⇒ Repeatedly
constructor
A new instance of Repeatedly.
- #pause ⇒ Object
- #start ⇒ Object
Constructor Details
#initialize(*paths, only: nil, except: nil, &block) ⇒ Repeatedly
Returns a new instance of Repeatedly.
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/lmkplz/repeatedly.rb', line 5 def initialize(*paths, only: nil, except: nil, &block) @block = block @file_filter = FileFilter.new(only: only, except: except) paths.each { |path| interface.add(path) } interface.on_success do |m, c, r| @file_filter.call(m, c, r) do |mm, cc, rr| @block.call(mm, cc, rr) end end end |
Instance Attribute Details
#callbacker ⇒ Object (readonly)
Returns the value of attribute callbacker.
3 4 5 |
# File 'lib/lmkplz/repeatedly.rb', line 3 def callbacker @callbacker end |
Instance Method Details
#pause ⇒ Object
24 25 26 27 28 29 30 31 |
# File 'lib/lmkplz/repeatedly.rb', line 24 def pause if @the_loop.nil? return end the_loop.kill @the_loop = nil end |
#start ⇒ Object
17 18 19 20 21 22 |
# File 'lib/lmkplz/repeatedly.rb', line 17 def start interface.malloc the_loop nil end |