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
-
#focusable=(value) ⇒ Boolean
Set whether this object is focusable or not.
-
#focusable? ⇒ Boolean
Get whether this object is focusable or not.
- #initialize(attributes = {}) ⇒ Object
Methods included from HasAttributes
Instance Method Details
#focusable=(value) ⇒ Boolean
Set whether this object is focusable or not.
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.
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 |