Class: Cura::FocusController

Inherits:
Object
  • Object
show all
Includes:
Attributes::HasApplication, Attributes::HasAttributes, Attributes::HasInitialize
Defined in:
lib/cura/focus_controller.rb

Instance Attribute Summary

Attributes included from Attributes::HasApplication

#application

Instance Method Summary collapse

Methods included from Attributes::HasAttributes

included, #update_attributes

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

#indexInteger

Get the index of the currently focused component.

Returns:

  • (Integer)


# 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.

Parameters:

  • value (#to_i)

Returns:

  • (Integer)


48
# File 'lib/cura/focus_controller.rb', line 48

attribute(:index) { |value| set_index(value) }

#windowWindow

Get the window of the currently focused component.

Returns:



# File 'lib/cura/focus_controller.rb', line 23

#window=(value) ⇒ Window

Set the window of the currently focused component.

Parameters:

  • value (#to_i)

Returns:



34
# File 'lib/cura/focus_controller.rb', line 34

attribute(:window) { |value| validate_window(value) }