Module: Cura::Attributes::HasFocusability

Includes:
HasAttributes
Included in:
Component::Base
Defined in:
lib/cura/attributes/has_focusability.rb

Overview

Adds the ‘focusable` attribute to objects.

Instance Method Summary collapse

Methods included from HasAttributes

included, #update_attributes

Instance Method Details

#focusable=(value) ⇒ Boolean

Set whether this object is focusable or not.

Parameters:

  • value (Object)

Returns:

  • (Boolean)


26
27
28
# File 'lib/cura/attributes/has_focusability.rb', line 26

def focusable=(value)
  @focusable = !!value
end

#focusable?Boolean

Get whether this object is focusable or not.

Returns:

  • (Boolean)


18
19
20
# File 'lib/cura/attributes/has_focusability.rb', line 18

def focusable?
  @focusable
end

#initialize(attributes = {}) ⇒ Object



9
10
11
12
13
# File 'lib/cura/attributes/has_focusability.rb', line 9

def initialize(attributes={})
  @focusable = false unless instance_variable_defined?(:@focusable)

  super
end