Class: FileWatch::Stat::WindowsPath
- Inherits:
-
Object
- Object
- FileWatch::Stat::WindowsPath
- Defined in:
- lib/filewatch/stat/windows_path.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) ⇒ WindowsPath
constructor
A new instance of WindowsPath.
- #inspect ⇒ Object
- #restat ⇒ Object
- #windows? ⇒ Boolean
Constructor Details
#initialize(source) ⇒ WindowsPath
8 9 10 11 12 13 14 |
# File 'lib/filewatch/stat/windows_path.rb', line 8 def initialize(source) @source = source # Pathname @inode = Winhelper.identifier_from_path(@source.to_path) # in windows the dev hi and low are in the identifier @inode_struct = InodeStruct.new(@inode, 0, 0) restat end |
Instance Attribute Details
#inode ⇒ Object (readonly)
Returns the value of attribute inode.
6 7 8 |
# File 'lib/filewatch/stat/windows_path.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/windows_path.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/windows_path.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/windows_path.rb', line 6 def size @size end |
Instance Method Details
#inspect ⇒ Object
26 27 28 |
# File 'lib/filewatch/stat/windows_path.rb', line 26 def inspect "<#{self.class.name} size=#{@size}, modified_at=#{@modified_at}, inode=#{@inode}, inode_struct=#{@inode_struct}>" end |
#restat ⇒ Object
16 17 18 19 20 |
# File 'lib/filewatch/stat/windows_path.rb', line 16 def restat stat = @source.stat @modified_at = stat.mtime.to_f @size = stat.size end |
#windows? ⇒ Boolean
22 23 24 |
# File 'lib/filewatch/stat/windows_path.rb', line 22 def windows? true end |