Class: Pixelflow::Canvas::Event
- Inherits:
-
Object
- Object
- Pixelflow::Canvas::Event
- Defined in:
- lib/pixelflow_canvas.rb
Overview
EVENT POLLING
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
-
#initialize(data) ⇒ Event
constructor
A new instance of Event.
- #on(type, &block) ⇒ Object
Constructor Details
#initialize(data) ⇒ Event
Returns a new instance of Event.
815 816 817 |
# File 'lib/pixelflow_canvas.rb', line 815 def initialize(data) @data = data end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
819 820 821 |
# File 'lib/pixelflow_canvas.rb', line 819 def data @data end |
Instance Method Details
#on(type, &block) ⇒ Object
821 822 823 824 825 |
# File 'lib/pixelflow_canvas.rb', line 821 def on(type, &block) if type == :mouse_move && @data[0] == 3 yield(@data[1], @data[2]) end end |