Class: Coyote::FSListeners::Polling
- Defined in:
- lib/coyote/fs_listeners/polling.rb
Instance Attribute Summary collapse
-
#callback ⇒ Object
readonly
Returns the value of attribute callback.
-
#latency ⇒ Object
readonly
Returns the value of attribute latency.
Attributes inherited from Base
#last_event, #sha1_checksums_hash
Instance Method Summary collapse
-
#initialize ⇒ Polling
constructor
A new instance of Polling.
- #on_change(&callback) ⇒ Object
- #start ⇒ Object
- #stop ⇒ Object
Methods inherited from Base
#modified_files, #update_last_event
Constructor Details
#initialize ⇒ Polling
Returns a new instance of Polling.
5 6 7 8 |
# File 'lib/coyote/fs_listeners/polling.rb', line 5 def initialize super @latency = 1.5 end |
Instance Attribute Details
#callback ⇒ Object (readonly)
Returns the value of attribute callback.
3 4 5 |
# File 'lib/coyote/fs_listeners/polling.rb', line 3 def callback @callback end |
#latency ⇒ Object (readonly)
Returns the value of attribute latency.
3 4 5 |
# File 'lib/coyote/fs_listeners/polling.rb', line 3 def latency @latency end |
Instance Method Details
#on_change(&callback) ⇒ Object
10 11 12 |
# File 'lib/coyote/fs_listeners/polling.rb', line 10 def on_change(&callback) @callback = callback end |
#start ⇒ Object
14 15 16 17 |
# File 'lib/coyote/fs_listeners/polling.rb', line 14 def start @stop = false watch_change end |
#stop ⇒ Object
19 20 21 |
# File 'lib/coyote/fs_listeners/polling.rb', line 19 def stop @stop = true end |