Class: FileWatch::Stat::WindowsPath

Inherits:
Object
  • Object
show all
Defined in:
lib/filewatch/stat/windows_path.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#inodeObject (readonly)

Returns the value of attribute inode.



6
7
8
# File 'lib/filewatch/stat/windows_path.rb', line 6

def inode
  @inode
end

#inode_structObject (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_atObject (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

#sizeObject (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

#inspectObject



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

#restatObject



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