Class: Rubydraw::MouseState
Overview
An instance of this class is returned every time you call Rubydraw.mouse_state.
Instance Attribute Summary collapse
-
#button ⇒ Object
readonly
Returns the value of attribute button.
-
#position ⇒ Object
readonly
Returns the value of attribute position.
Instance Method Summary collapse
-
#initialize(button, position) ⇒ MouseState
constructor
A new instance of MouseState.
- #to_ary ⇒ Object
- #x ⇒ Object
- #y ⇒ Object
Constructor Details
#initialize(button, position) ⇒ MouseState
Returns a new instance of MouseState.
7 8 9 |
# File 'lib/rubydraw/mouse_state.rb', line 7 def initialize(, position) @button, @position = , position end |
Instance Attribute Details
#button ⇒ Object (readonly)
Returns the value of attribute button.
5 6 7 |
# File 'lib/rubydraw/mouse_state.rb', line 5 def @button end |
#position ⇒ Object (readonly)
Returns the value of attribute position.
5 6 7 |
# File 'lib/rubydraw/mouse_state.rb', line 5 def position @position end |
Instance Method Details
#to_ary ⇒ Object
19 20 21 |
# File 'lib/rubydraw/mouse_state.rb', line 19 def to_ary [@button, x, y] end |
#x ⇒ Object
11 12 13 |
# File 'lib/rubydraw/mouse_state.rb', line 11 def x @position.x end |
#y ⇒ Object
15 16 17 |
# File 'lib/rubydraw/mouse_state.rb', line 15 def y @position.y end |