Class: Remian::Clock
- Inherits:
-
Object
- Object
- Remian::Clock
- Defined in:
- lib/remian/clock.rb
Instance Attribute Summary collapse
-
#delay ⇒ Object
Returns the value of attribute delay.
-
#speed ⇒ Object
Returns the value of attribute speed.
Instance Method Summary collapse
-
#initialize(speed) ⇒ Clock
constructor
A new instance of Clock.
- #tick_delay ⇒ Object
Constructor Details
#initialize(speed) ⇒ Clock
Returns a new instance of Clock.
5 6 7 8 |
# File 'lib/remian/clock.rb', line 5 def initialize speed @speed = speed.to_f @delay = 1.0 / @speed end |
Instance Attribute Details
#delay ⇒ Object
Returns the value of attribute delay.
3 4 5 |
# File 'lib/remian/clock.rb', line 3 def delay @delay end |
#speed ⇒ Object
Returns the value of attribute speed.
3 4 5 |
# File 'lib/remian/clock.rb', line 3 def speed @speed end |
Instance Method Details
#tick_delay ⇒ Object
10 11 12 |
# File 'lib/remian/clock.rb', line 10 def tick_delay sleep @delay end |