Class: Cliptic::Main::Player::Timer
- Inherits:
-
Object
- Object
- Cliptic::Main::Player::Timer
- Defined in:
- lib/cliptic/main.rb
Instance Attribute Summary collapse
-
#bar ⇒ Object
readonly
Returns the value of attribute bar.
-
#callback ⇒ Object
readonly
Returns the value of attribute callback.
-
#run ⇒ Object
readonly
Returns the value of attribute run.
-
#time ⇒ Object
readonly
Returns the value of attribute time.
Instance Method Summary collapse
-
#initialize(time: 0, bar:, callback:) ⇒ Timer
constructor
A new instance of Timer.
- #reset ⇒ Object
- #start ⇒ Object
- #stop ⇒ Object
Constructor Details
Instance Attribute Details
#bar ⇒ Object (readonly)
Returns the value of attribute bar.
720 721 722 |
# File 'lib/cliptic/main.rb', line 720 def @bar end |
#callback ⇒ Object (readonly)
Returns the value of attribute callback.
720 721 722 |
# File 'lib/cliptic/main.rb', line 720 def callback @callback end |
#run ⇒ Object (readonly)
Returns the value of attribute run.
720 721 722 |
# File 'lib/cliptic/main.rb', line 720 def run @run end |
#time ⇒ Object (readonly)
Returns the value of attribute time.
720 721 722 |
# File 'lib/cliptic/main.rb', line 720 def time @time end |
Instance Method Details
#reset ⇒ Object
732 733 734 735 |
# File 'lib/cliptic/main.rb', line 732 def reset @time = Time.abs(0) @run = false end |
#start ⇒ Object
725 726 727 728 |
# File 'lib/cliptic/main.rb', line 725 def start Thread.new{tick} @run = true end |
#stop ⇒ Object
729 730 731 |
# File 'lib/cliptic/main.rb', line 729 def stop @run = false end |