Class: ForestAdminDatasourceToolkit::Components::Actions::ActionField
- Inherits:
-
Object
- Object
- ForestAdminDatasourceToolkit::Components::Actions::ActionField
- Defined in:
- lib/forest_admin_datasource_toolkit/components/actions/action_field.rb
Direct Known Subclasses
WidgetField::AddressAutocompleteField, WidgetField::CheckboxField, WidgetField::CheckboxGroupField, WidgetField::ColorPickerField, WidgetField::CurrencyInputField, WidgetField::DatePickerField, WidgetField::DropdownField, WidgetField::FilePickerField, WidgetField::JsonEditorField, WidgetField::NumberInputField, WidgetField::NumberInputListField, WidgetField::RadioGroupField, WidgetField::RichTextField, WidgetField::TextAreaField, WidgetField::TextInputField, WidgetField::TextInputListField, WidgetField::TimePickerField, WidgetField::UserDropdownField
Instance Attribute Summary collapse
-
#collection_name ⇒ Object
readonly
Returns the value of attribute collection_name.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#enum_values ⇒ Object
readonly
Returns the value of attribute enum_values.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#is_read_only ⇒ Object
readonly
Returns the value of attribute is_read_only.
-
#is_required ⇒ Object
readonly
Returns the value of attribute is_required.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#placeholder ⇒ Object
readonly
Returns the value of attribute placeholder.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#value ⇒ Object
Returns the value of attribute value.
-
#watch_changes ⇒ Object
Returns the value of attribute watch_changes.
-
#widget ⇒ Object
readonly
Returns the value of attribute widget.
Instance Method Summary collapse
-
#initialize(type:, label: nil, id: nil, description: nil, is_required: false, is_read_only: false, value: nil, enum_values: nil, collection_name: nil, watch_changes: false, placeholder: nil, **_kwargs) ⇒ ActionField
constructor
A new instance of ActionField.
- #to_h ⇒ Object
- #watch_changes? ⇒ Boolean
Constructor Details
#initialize(type:, label: nil, id: nil, description: nil, is_required: false, is_read_only: false, value: nil, enum_values: nil, collection_name: nil, watch_changes: false, placeholder: nil, **_kwargs) ⇒ ActionField
Returns a new instance of ActionField.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/forest_admin_datasource_toolkit/components/actions/action_field.rb', line 9 def initialize( type:, label: nil, id: nil, description: nil, is_required: false, is_read_only: false, value: nil, enum_values: nil, collection_name: nil, watch_changes: false, placeholder: nil, **_kwargs ) @type = type @label = label @id = id @description = description @is_required = is_required @is_read_only = is_read_only @value = value @enum_values = enum_values @collection_name = collection_name @watch_changes = watch_changes = nil @placeholder = placeholder end |
Instance Attribute Details
#collection_name ⇒ Object (readonly)
Returns the value of attribute collection_name.
6 7 8 |
# File 'lib/forest_admin_datasource_toolkit/components/actions/action_field.rb', line 6 def collection_name @collection_name end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
6 7 8 |
# File 'lib/forest_admin_datasource_toolkit/components/actions/action_field.rb', line 6 def description @description end |
#enum_values ⇒ Object (readonly)
Returns the value of attribute enum_values.
6 7 8 |
# File 'lib/forest_admin_datasource_toolkit/components/actions/action_field.rb', line 6 def enum_values @enum_values end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
6 7 8 |
# File 'lib/forest_admin_datasource_toolkit/components/actions/action_field.rb', line 6 def id @id end |
#is_read_only ⇒ Object (readonly)
Returns the value of attribute is_read_only.
6 7 8 |
# File 'lib/forest_admin_datasource_toolkit/components/actions/action_field.rb', line 6 def is_read_only @is_read_only end |
#is_required ⇒ Object (readonly)
Returns the value of attribute is_required.
6 7 8 |
# File 'lib/forest_admin_datasource_toolkit/components/actions/action_field.rb', line 6 def is_required @is_required end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
6 7 8 |
# File 'lib/forest_admin_datasource_toolkit/components/actions/action_field.rb', line 6 def label @label end |
#placeholder ⇒ Object (readonly)
Returns the value of attribute placeholder.
6 7 8 |
# File 'lib/forest_admin_datasource_toolkit/components/actions/action_field.rb', line 6 def placeholder @placeholder end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
6 7 8 |
# File 'lib/forest_admin_datasource_toolkit/components/actions/action_field.rb', line 6 def type @type end |
#value ⇒ Object
Returns the value of attribute value.
5 6 7 |
# File 'lib/forest_admin_datasource_toolkit/components/actions/action_field.rb', line 5 def value @value end |
#watch_changes ⇒ Object
Returns the value of attribute watch_changes.
5 6 7 |
# File 'lib/forest_admin_datasource_toolkit/components/actions/action_field.rb', line 5 def watch_changes @watch_changes end |
#widget ⇒ Object (readonly)
Returns the value of attribute widget.
6 7 8 |
# File 'lib/forest_admin_datasource_toolkit/components/actions/action_field.rb', line 6 def end |
Instance Method Details
#to_h ⇒ Object
41 42 43 44 45 46 47 48 |
# File 'lib/forest_admin_datasource_toolkit/components/actions/action_field.rb', line 41 def to_h result = {} instance_variables.each do |attribute| result[attribute.to_s.delete('@').to_sym] = instance_variable_get(attribute) end result end |
#watch_changes? ⇒ Boolean
37 38 39 |
# File 'lib/forest_admin_datasource_toolkit/components/actions/action_field.rb', line 37 def watch_changes? @watch_changes end |