Class: Mxrb::Dsl::ContainerBuilder
- Inherits:
-
Object
- Object
- Mxrb::Dsl::ContainerBuilder
- Includes:
- WidgetDsl
- Defined in:
- lib/mxrb/dsl/builder.rb
Overview
Builds nested widgets inside a container widget.
Instance Method Summary collapse
-
#initialize(name, class_name: nil) ⇒ ContainerBuilder
constructor
A new instance of ContainerBuilder.
- #to_h ⇒ Object
Methods included from WidgetDsl
#bson_binary, #button, #check_box, #container, #data_grid, #date_picker, #drop_down, #native_widget, #number_input, #pluggable_widget, #reference_selector, #snippet, #tab_control, #text, #text_area, #text_box
Constructor Details
#initialize(name, class_name: nil) ⇒ ContainerBuilder
Returns a new instance of ContainerBuilder.
271 272 273 274 275 |
# File 'lib/mxrb/dsl/builder.rb', line 271 def initialize(name, class_name: nil) @name = name.to_s @class_name = class_name&.to_s @children = [] end |
Instance Method Details
#to_h ⇒ Object
277 278 279 280 281 |
# File 'lib/mxrb/dsl/builder.rb', line 277 def to_h opts = {} opts[:class] = @class_name if @class_name && !@class_name.empty? { type: :container, name: @name, options: opts, children: @children, events: [] } end |