Class: Build::Files::State::FileTime

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
lib/build/files/state.rb

Overview

Represents a specific file on disk with a specific mtime.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, time) ⇒ FileTime

Returns a new instance of FileTime.



35
36
37
38
# File 'lib/build/files/state.rb', line 35

def initialize(path, time)
  @path = path
  @time = time
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



40
41
42
# File 'lib/build/files/state.rb', line 40

def path
  @path
end

#timeObject (readonly)

Returns the value of attribute time.



41
42
43
# File 'lib/build/files/state.rb', line 41

def time
  @time
end

Instance Method Details

#<=>(other) ⇒ Object



43
44
45
# File 'lib/build/files/state.rb', line 43

def <=> other
  @time <=> other.time
end

#inspectObject



47
48
49
# File 'lib/build/files/state.rb', line 47

def inspect
  "<FileTime #{@path.inspect} #{@time.inspect}>"
end