Class Sinotify::Watch

  1. lib/sinotify/watch.rb
Parent: Object

Just a little struct to describe a single inotifier watch Note that the is_dir needs to be saved because we won’t be able to deduce that later if it was a deleted object.

Methods

public class

  1. new

public instance

  1. directory?
  2. to_s

Attributes

is_dir [RW]
path [RW]
watch_descriptor [RW]

Public class methods

new (args={})
[show source]
# File lib/sinotify/watch.rb, line 9
    def initialize(args={})
      args.each{|k,v| self.send("#{k}=",v)}
      @timestamp ||= Time.now
      @is_dir = File.directory?(path)
    end

Public instance methods

directory? ()
[show source]
# File lib/sinotify/watch.rb, line 14
    def directory?
      self.is_dir.eql?(true)
    end
to_s ()
[show source]
# File lib/sinotify/watch.rb, line 17
    def to_s
      "Sinotify::Watch[:is_dir => #{is_dir}, :path => #{path}, :watch_descriptor => #{watch_descriptor}]"
    end