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.
228 229 230 231 232 |
# File 'lib/mxrb/dsl/builder.rb', line 228 def initialize(name, class_name: nil) @name = name.to_s @class_name = class_name&.to_s @children = [] end |
Instance Method Details
#to_h ⇒ Object
234 235 236 237 238 |
# File 'lib/mxrb/dsl/builder.rb', line 234 def to_h opts = {} opts[:class] = @class_name if @class_name && !@class_name.empty? { type: :container, name: @name, options: opts, children: @children, events: [] } end |