Class: Nuklear::UI::Selectable
- Includes:
- TextAlign
- Defined in:
- lib/nuklear/ui/selectable.rb
Instance Attribute Summary collapse
-
#align ⇒ Object
Returns the value of attribute align.
-
#image ⇒ Object
Returns the value of attribute image.
-
#text ⇒ Object
Returns the value of attribute text.
Instance Method Summary collapse
-
#initialize(text: nil, align: :left, image: nil, selected: false, **options, &block) ⇒ Selectable
constructor
A new instance of Selectable.
- #to_command ⇒ Object
Methods included from TextAlign
Methods inherited from Checkbox
Methods inherited from Base
Methods included from Enableable
#disable, #disabled=, #disabled?, #enable, #enabled=, #enabled?
Methods included from Events
#event_listeners_for, #on, #trigger
Constructor Details
#initialize(text: nil, align: :left, image: nil, selected: false, **options, &block) ⇒ Selectable
Returns a new instance of Selectable.
8 9 10 11 12 13 14 |
# File 'lib/nuklear/ui/selectable.rb', line 8 def initialize(text: nil, align: :left, image: nil, selected: false, **, &block) super(**, &block) self.selected = selected @text = text @image = image @align = align end |
Instance Attribute Details
#align ⇒ Object
Returns the value of attribute align.
6 7 8 |
# File 'lib/nuklear/ui/selectable.rb', line 6 def align @align end |
#image ⇒ Object
Returns the value of attribute image.
6 7 8 |
# File 'lib/nuklear/ui/selectable.rb', line 6 def image @image end |
#text ⇒ Object
Returns the value of attribute text.
6 7 8 |
# File 'lib/nuklear/ui/selectable.rb', line 6 def text @text end |
Instance Method Details
#to_command ⇒ Object
16 17 18 |
# File 'lib/nuklear/ui/selectable.rb', line 16 def to_command [ :ui_selectable, image, text, selected?, align_as_flags(align) ] end |