Class: Clock::Substitute

Inherits:
Object
  • Object
show all
Includes:
Clock
Defined in:
lib/clock/substitute.rb

Defined Under Namespace

Classes: SubstituteSystemTime

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Clock

#canonize, #elapsed_milliseconds, included, #iso8601, local, #now, #parse, #timestamp, utc

Methods included from Now

#now

Methods included from Canonize

#canonize

Methods included from ISO8601

#iso8601, #precision

Methods included from Parse

#parse

Methods included from ElapsedMilliseconds

#elapsed_milliseconds

Methods included from Timestamp

#timestamp

Instance Attribute Details

#system_timeObject



7
8
9
# File 'lib/clock/substitute.rb', line 7

def system_time
  @system_time ||= Clock.system_time
end

Instance Method Details

#now=(val) ⇒ Object



11
12
13
14
15
# File 'lib/clock/substitute.rb', line 11

def now=(val)
  self.system_time = SubstituteSystemTime.new
  system_time.now = val
  system_time
end