Class: Worlds::Components::Ticker

Inherits:
Component
  • Object
show all
Defined in:
lib/worlds/components/ticker.rb

Instance Attribute Summary

Attributes inherited from Component

#commands, #owner

Instance Method Summary collapse

Methods inherited from Component

#initialize, #invoke, #select, #select_heading, #select_options

Constructor Details

This class inherits a constructor from Worlds::Components::Component

Instance Method Details

#update(ms) ⇒ Object



4
5
6
7
# File 'lib/worlds/components/ticker.rb', line 4

def update(ms)
  @tick = !@tick
  { color: :blue, content: @tick ? 'Tick!' : 'Tock!' }
end