Class: Cura::FocusController
- Inherits:
-
Object
- Object
- Cura::FocusController
- Defined in:
- lib/cura/focus_controller.rb
Instance Attribute Summary
Attributes included from Attributes::HasApplication
Instance Method Summary collapse
-
#index ⇒ Integer
Get the index of the currently focused component.
-
#index=(value) ⇒ Integer
Set the index of the currently focused component.
-
#initialize(attributes = {}) ⇒ FocusController
constructor
A new instance of FocusController.
-
#window ⇒ Window
Get the window of the currently focused component.
-
#window=(value) ⇒ Window
Set the window of the currently focused component.
Methods included from Attributes::HasAttributes
Constructor Details
#initialize(attributes = {}) ⇒ FocusController
Returns a new instance of FocusController.
15 16 17 18 19 20 21 |
# File 'lib/cura/focus_controller.rb', line 15 def initialize(attributes={}) @index = 0 super # TODO: raise error if window or application is nil end |
Instance Method Details
#index ⇒ Integer
Get the index of the currently focused component.
|
# File 'lib/cura/focus_controller.rb', line 36
|
#index=(value) ⇒ Integer
Set the index of the currently focused component. This will dispatch a Event::Focus instance to the object.
48 |
# File 'lib/cura/focus_controller.rb', line 48 attribute(:index) { |value| set_index(value) } |
#window ⇒ Window
Get the window of the currently focused component.
|
# File 'lib/cura/focus_controller.rb', line 23
|
#window=(value) ⇒ Window
Set the window of the currently focused component.
34 |
# File 'lib/cura/focus_controller.rb', line 34 attribute(:window) { |value| validate_window(value) } |