Class: FileWatch::Stat::Generic
- Inherits:
-
Object
- Object
- FileWatch::Stat::Generic
- Defined in:
- lib/filewatch/stat/generic.rb
Instance Attribute Summary collapse
-
#inode ⇒ Object
readonly
Returns the value of attribute inode.
-
#inode_struct ⇒ Object
readonly
Returns the value of attribute inode_struct.
-
#modified_at ⇒ Object
readonly
Returns the value of attribute modified_at.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
Instance Method Summary collapse
-
#initialize(source) ⇒ Generic
constructor
A new instance of Generic.
- #inspect ⇒ Object
- #restat ⇒ Object
- #windows? ⇒ Boolean
Constructor Details
#initialize(source) ⇒ Generic
Returns a new instance of Generic.
8 9 10 11 |
# File 'lib/filewatch/stat/generic.rb', line 8 def initialize(source) @source = source # Pathname restat end |
Instance Attribute Details
#inode ⇒ Object (readonly)
Returns the value of attribute inode.
6 7 8 |
# File 'lib/filewatch/stat/generic.rb', line 6 def inode @inode end |
#inode_struct ⇒ Object (readonly)
Returns the value of attribute inode_struct.
6 7 8 |
# File 'lib/filewatch/stat/generic.rb', line 6 def inode_struct @inode_struct end |
#modified_at ⇒ Object (readonly)
Returns the value of attribute modified_at.
6 7 8 |
# File 'lib/filewatch/stat/generic.rb', line 6 def modified_at @modified_at end |
#size ⇒ Object (readonly)
Returns the value of attribute size.
6 7 8 |
# File 'lib/filewatch/stat/generic.rb', line 6 def size @size end |
Instance Method Details
#inspect ⇒ Object
25 26 27 |
# File 'lib/filewatch/stat/generic.rb', line 25 def inspect "<#{self.class.name} size=#{@size}, modified_at=#{@modified_at}, inode='#{@inode}', inode_struct=#{@inode_struct}>" end |
#restat ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/filewatch/stat/generic.rb', line 13 def restat stat = @source.stat @inode = stat.ino.to_s @modified_at = stat.mtime.to_f @size = stat.size @inode_struct = InodeStruct.new(@inode, stat.dev_major, stat.dev_minor) end |
#windows? ⇒ Boolean
21 22 23 |
# File 'lib/filewatch/stat/generic.rb', line 21 def windows? false end |