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.



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

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

Instance Attribute Details

#timeObject (readonly)

Returns the system’s time as a Ruby Time.



72
73
74
# File 'lib/madeleine/clock.rb', line 72

def time
  @time
end

Instance Method Details

#forward_to(newTime) ⇒ Object



78
79
80
# File 'lib/madeleine/clock.rb', line 78

def forward_to(newTime)
  @time = newTime
end