Class: FSEvents::Event

Inherits:
Object
  • Object
show all
Defined in:
lib/fsevents/event.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, path, stream) ⇒ Event

Returns a new instance of Event.



5
6
7
8
9
# File 'lib/fsevents/event.rb', line 5

def initialize(id, path, stream)
  @id     = id
  @path   = path
  @stream = stream
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



3
4
5
# File 'lib/fsevents/event.rb', line 3

def id
  @id
end

#pathObject (readonly)

Returns the value of attribute path.



3
4
5
# File 'lib/fsevents/event.rb', line 3

def path
  @path
end

#streamObject (readonly)

Returns the value of attribute stream.



3
4
5
# File 'lib/fsevents/event.rb', line 3

def stream
  @stream
end

Instance Method Details

#filesObject



11
12
13
# File 'lib/fsevents/event.rb', line 11

def files
  Dir["#{path}/*"]
end

#modified_filesObject



15
16
17
# File 'lib/fsevents/event.rb', line 15

def modified_files
  files.select { |f|  File.mtime(f) >= stream.last_event }
end