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)


30
31
32
# File 'lib/cura/attributes/has_focusability.rb', line 30

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

#focusable?Boolean

Get whether this object is focusable or not.

Returns:

  • (Boolean)


22
23
24
# File 'lib/cura/attributes/has_focusability.rb', line 22

def focusable?
  @focusable
end

#initialize(attributes = {}) ⇒ Object



13
14
15
16
17
# File 'lib/cura/attributes/has_focusability.rb', line 13

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