Class: ForestAdminDatasourceToolkit::Components::Actions::ActionLayoutElement::BaseLayoutElement
- Inherits:
-
Object
- Object
- ForestAdminDatasourceToolkit::Components::Actions::ActionLayoutElement::BaseLayoutElement
- Defined in:
- lib/forest_admin_datasource_toolkit/components/actions/action_layout_element.rb
Direct Known Subclasses
HtmlBlockElement, InputElement, PageElement, RowElement, SeparatorElement
Instance Attribute Summary collapse
-
#component ⇒ Object
readonly
Returns the value of attribute component.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(component:, **_kwargs) ⇒ BaseLayoutElement
constructor
A new instance of BaseLayoutElement.
- #to_h ⇒ Object
Constructor Details
#initialize(component:, **_kwargs) ⇒ BaseLayoutElement
Returns a new instance of BaseLayoutElement.
10 11 12 13 |
# File 'lib/forest_admin_datasource_toolkit/components/actions/action_layout_element.rb', line 10 def initialize(component:, **_kwargs) @type = FieldType::LAYOUT @component = component end |
Instance Attribute Details
#component ⇒ Object (readonly)
Returns the value of attribute component.
8 9 10 |
# File 'lib/forest_admin_datasource_toolkit/components/actions/action_layout_element.rb', line 8 def component @component end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
8 9 10 |
# File 'lib/forest_admin_datasource_toolkit/components/actions/action_layout_element.rb', line 8 def type @type end |
Instance Method Details
#to_h ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/forest_admin_datasource_toolkit/components/actions/action_layout_element.rb', line 15 def to_h result = {} instance_variables.each do |attribute| result[attribute.to_s.delete('@').camelize(:lower).to_sym] = instance_variable_get(attribute) end result end |