Class: ViewComponent::Storybook::Controls::BaseOptionsConfig
- Inherits:
-
SimpleControlConfig
- Object
- ControlConfig
- SimpleControlConfig
- ViewComponent::Storybook::Controls::BaseOptionsConfig
- Defined in:
- lib/view_component/storybook/controls/base_options_config.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#labels ⇒ Object
readonly
Returns the value of attribute labels.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Attributes inherited from SimpleControlConfig
Instance Method Summary collapse
-
#initialize(type, options, default_value, labels: nil, param: nil, name: nil, description: nil) ⇒ BaseOptionsConfig
constructor
A new instance of BaseOptionsConfig.
- #to_csf_params ⇒ Object
Methods inherited from SimpleControlConfig
Methods inherited from ControlConfig
#description, #name, #param, #prefix_param, #value_from_params
Constructor Details
#initialize(type, options, default_value, labels: nil, param: nil, name: nil, description: nil) ⇒ BaseOptionsConfig
Returns a new instance of BaseOptionsConfig.
11 12 13 14 15 16 17 |
# File 'lib/view_component/storybook/controls/base_options_config.rb', line 11 def initialize(type, , default_value, labels: nil, param: nil, name: nil, description: nil) super(default_value, param: param, name: name, description: description) @type = type @options = @labels = labels end |
Instance Attribute Details
#labels ⇒ Object (readonly)
Returns the value of attribute labels.
7 8 9 |
# File 'lib/view_component/storybook/controls/base_options_config.rb', line 7 def labels @labels end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
7 8 9 |
# File 'lib/view_component/storybook/controls/base_options_config.rb', line 7 def @options end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
7 8 9 |
# File 'lib/view_component/storybook/controls/base_options_config.rb', line 7 def type @type end |
Instance Method Details
#to_csf_params ⇒ Object
19 20 21 |
# File 'lib/view_component/storybook/controls/base_options_config.rb', line 19 def to_csf_params super.deep_merge(argTypes: { param => { options: } }) end |