Parent

Included Modules

Listen::Record

Attributes

listener[RW]
paths[RW]

Public Class Methods

new(listener) click to toggle source
# File lib/listen/record.rb, line 7
def initialize(listener)
  @listener = listener
  @paths    = _init_paths
end

Public Instance Methods

build() click to toggle source
# File lib/listen/record.rb, line 29
def build
  @paths = _init_paths
  listener.directories.each do |path|
    options = { type: 'Dir', recursive: true, silence: true }
    listener.registry[:change_pool].change(path, options)
  end
end
dir_entries(path) click to toggle source
# File lib/listen/record.rb, line 25
def dir_entries(path)
  @paths[path.to_s]
end
file_data(path) click to toggle source
# File lib/listen/record.rb, line 21
def file_data(path)
  @paths[::File.dirname(path)][::File.basename(path)] || {}
end
set_path(path, data) click to toggle source
# File lib/listen/record.rb, line 12
def set_path(path, data)
  new_data = file_data(path).merge(data)
  @paths[::File.dirname(path)][::File.basename(path)] = new_data
end
unset_path(path) click to toggle source
# File lib/listen/record.rb, line 17
def unset_path(path)
  @paths[::File.dirname(path)].delete(::File.basename(path))
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.