Class: Herve::Cache::Timestamp

Inherits:
Object
  • Object
show all
Defined in:
lib/herve/cache/timestamp.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(time) ⇒ Timestamp

Returns a new instance of Timestamp.

Parameters:



21
22
23
# File 'lib/herve/cache/timestamp.rb', line 21

def initialize(time)
  @time = time
end

Instance Attribute Details

#timeTime (readonly)

Returns:



5
6
7
# File 'lib/herve/cache/timestamp.rb', line 5

def time
  @time
end

Class Method Details

.nowTimestamp

Returns:



15
16
17
# File 'lib/herve/cache/timestamp.rb', line 15

def now
  new(Time.now)
end

.path(path) ⇒ Timestamp

Parameters:

Returns:



10
11
12
# File 'lib/herve/cache/timestamp.rb', line 10

def path(path)
  new(path.ctime)
end