Class: Madeleine::Clock::Clock
- Inherits:
-
Object
- Object
- Madeleine::Clock::Clock
- Defined in:
- lib/madeleine/clock.rb
Overview
Keeps track of time in a ClockedSystem.
Instance Attribute Summary collapse
-
#time ⇒ Object
readonly
Returns the system’s time as a Ruby
Time
.
Instance Method Summary collapse
- #forward_to(newTime) ⇒ Object
-
#initialize ⇒ Clock
constructor
A new instance of Clock.
Constructor Details
#initialize ⇒ Clock
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
#time ⇒ Object (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 |