Class: Nuklear::UI::Base
- Inherits:
-
Object
- Object
- Nuklear::UI::Base
- Includes:
- Enableable, Events
- Defined in:
- lib/nuklear/ui/base.rb
Direct Known Subclasses
Button, Checkbox, Col, ColorPicker, ComboBox, EditString, Group, Label, Menu, MenuBar, MenuItem, OptionGroup, Progress, Property, Row, SelectList, Slider, Tree, Window
Class Attribute Summary collapse
Class Method Summary collapse
Instance Method Summary collapse
- #dsl(&block) ⇒ Object
-
#initialize(enabled: true) ⇒ Base
constructor
A new instance of Base.
Methods included from Enableable
#disable, #disabled=, #disabled?, #enable, #enabled=, #enabled?
Methods included from Events
#event_listeners_for, #on, #trigger
Constructor Details
#initialize(enabled: true) ⇒ Base
Returns a new instance of Base.
7 8 9 |
# File 'lib/nuklear/ui/base.rb', line 7 def initialize(enabled: true) self.enabled = enabled end |
Class Attribute Details
.dsl_method_name ⇒ Object
19 20 21 22 |
# File 'lib/nuklear/ui/base.rb', line 19 def dsl_method_name # Nukelar::UI::ColorPicker => 'color_picker' @dsl_method_name ||= name.split('::').last.gsub(/([A-Z])/) { |a| "_#{a.downcase}" }.sub(/^_/, '') end |
Class Method Details
.descendants ⇒ Object
24 25 26 |
# File 'lib/nuklear/ui/base.rb', line 24 def descendants @descendants ||= [] end |
.inherited(child) ⇒ Object
28 29 30 |
# File 'lib/nuklear/ui/base.rb', line 28 def inherited(child) descendants << child end |