Module: Funl::HistoryWorker
- Defined in:
- lib/funl/history-worker.rb
Instance Attribute Summary collapse
-
#history ⇒ Object
readonly
Returns the value of attribute history.
Instance Method Summary collapse
Instance Attribute Details
#history ⇒ Object (readonly)
Returns the value of attribute history.
2 3 4 |
# File 'lib/funl/history-worker.rb', line 2 def history @history end |
Instance Method Details
#initialize(client) ⇒ Object
4 5 6 7 8 |
# File 'lib/funl/history-worker.rb', line 4 def initialize client super @history = client.history_size && Array.new(client.history_size) # nil in case of use without UDP end |
#record_history(msg) ⇒ Object
10 11 12 |
# File 'lib/funl/history-worker.rb', line 10 def record_history msg history[global_tick % history.size] = msg if history end |