Class: Madeleine::Clock::Clock

Inherits:
Object
  • Object
show all
Defined in:
lib/madeleine/clock.rb

Overview

Keeps track of time in a ClockedSystem.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeClock

Returns a new instance of Clock.



70
71
72
# File 'lib/madeleine/clock.rb', line 70

def initialize
  @time = Time.at(0)
end

Instance Attribute Details

#timeObject (readonly)

Returns the system’s time as a Ruby Time.



68
69
70
# File 'lib/madeleine/clock.rb', line 68

def time
  @time
end

Instance Method Details

#forward_to(new_time) ⇒ Object



74
75
76
# File 'lib/madeleine/clock.rb', line 74

def forward_to(new_time)
  @time = new_time
end