Class: FileWatch::Watch::WatchedFile
- Inherits:
-
Object
- Object
- FileWatch::Watch::WatchedFile
- Defined in:
- lib/filewatch/watch.rb
Instance Attribute Summary collapse
-
#create_sent ⇒ Object
writeonly
Sets the attribute create_sent.
-
#initial ⇒ Object
writeonly
Sets the attribute initial.
-
#inode ⇒ Object
readonly
Returns the value of attribute inode.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
-
#timeout_sent ⇒ Object
writeonly
Sets the attribute timeout_sent.
Class Method Summary collapse
Instance Method Summary collapse
- #clear_timeout ⇒ Object
- #create_sent? ⇒ Boolean
- #initial? ⇒ Boolean
-
#initialize(path, inode, initial) ⇒ WatchedFile
constructor
A new instance of WatchedFile.
- #timeout_sent? ⇒ Boolean
- #to_s ⇒ Object
- #update(stat, inode = nil) ⇒ Object
Constructor Details
#initialize(path, inode, initial) ⇒ WatchedFile
Returns a new instance of WatchedFile.
22 23 24 25 26 |
# File 'lib/filewatch/watch.rb', line 22 def initialize(path, inode, initial) @path = path @size, @create_sent, @timeout_sent = 0, false, false @inode, @initial = inode, initial end |
Instance Attribute Details
#create_sent=(value) ⇒ Object (writeonly)
Sets the attribute create_sent
18 19 20 |
# File 'lib/filewatch/watch.rb', line 18 def create_sent=(value) @create_sent = value end |
#initial=(value) ⇒ Object (writeonly)
Sets the attribute initial
18 19 20 |
# File 'lib/filewatch/watch.rb', line 18 def initial=(value) @initial = value end |
#inode ⇒ Object (readonly)
Returns the value of attribute inode.
17 18 19 |
# File 'lib/filewatch/watch.rb', line 17 def inode @inode end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
20 21 22 |
# File 'lib/filewatch/watch.rb', line 20 def path @path end |
#size ⇒ Object (readonly)
Returns the value of attribute size.
17 18 19 |
# File 'lib/filewatch/watch.rb', line 17 def size @size end |
#timeout_sent=(value) ⇒ Object (writeonly)
Sets the attribute timeout_sent
18 19 20 |
# File 'lib/filewatch/watch.rb', line 18 def timeout_sent=(value) @timeout_sent = value end |
Class Method Details
.new_initial(path, inode) ⇒ Object
9 10 11 |
# File 'lib/filewatch/watch.rb', line 9 def self.new_initial(path, inode) new(path, inode, true) end |
.new_ongoing(path, inode) ⇒ Object
13 14 15 |
# File 'lib/filewatch/watch.rb', line 13 def self.new_ongoing(path, inode) new(path, inode, false) end |
Instance Method Details
#clear_timeout ⇒ Object
33 34 35 |
# File 'lib/filewatch/watch.rb', line 33 def clear_timeout @timeout_sent = false end |
#create_sent? ⇒ Boolean
37 38 39 |
# File 'lib/filewatch/watch.rb', line 37 def create_sent? @create_sent end |
#initial? ⇒ Boolean
41 42 43 |
# File 'lib/filewatch/watch.rb', line 41 def initial? @initial end |
#timeout_sent? ⇒ Boolean
45 46 47 |
# File 'lib/filewatch/watch.rb', line 45 def timeout_sent? @timeout_sent end |
#to_s ⇒ Object
49 |
# File 'lib/filewatch/watch.rb', line 49 def to_s() inspect; end |
#update(stat, inode = nil) ⇒ Object
28 29 30 31 |
# File 'lib/filewatch/watch.rb', line 28 def update(stat, inode = nil) @size = stat.size @inode = inode if inode end |