Class: Listen::Directory
- Inherits:
-
Object
- Object
- Listen::Directory
- Defined in:
- lib/listen/directory.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
-
#path ⇒ Object
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(path, options = {}) ⇒ Directory
constructor
A new instance of Directory.
- #scan ⇒ Object
Constructor Details
#initialize(path, options = {}) ⇒ Directory
Returns a new instance of Directory.
5 6 7 8 |
# File 'lib/listen/directory.rb', line 5 def initialize(path, = {}) @path = path @options = end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
3 4 5 |
# File 'lib/listen/directory.rb', line 3 def @options end |
#path ⇒ Object
Returns the value of attribute path.
3 4 5 |
# File 'lib/listen/directory.rb', line 3 def path @path end |
Instance Method Details
#scan ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/listen/directory.rb', line 10 def scan _update_record _all_entries.each do |entry_path, data| case data[:type] when 'File' then _async_change(entry_path, .merge(type: 'File')) when 'Dir' _async_change(entry_path, .merge(type: 'Dir')) if _recursive_scan?(entry_path) end end end |