Class: DirectoryWatcher::Event

Inherits:
Struct
  • Object
show all
Defined in:
lib/directory_watcher.rb

Overview

An Event structure contains the type of the event and the file path to which the event pertains. The type can be one of the following:

:added      =>  file has been added to the directory
:modified   =>  file has been modified (either mtime or size or both
                have changed)
:removed    =>  file has been removed from the directory
:stable     =>  file has stabilized since being added or modified

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#pathObject

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



234
235
236
# File 'lib/directory_watcher.rb', line 234

def path
  @path
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



234
235
236
# File 'lib/directory_watcher.rb', line 234

def type
  @type
end

Instance Method Details

#to_sObject



235
# File 'lib/directory_watcher.rb', line 235

def to_s( ) "#{type} '#{path}'" end