Class: ViewComponent::Storybook::Controls::BaseOptions
- Inherits:
-
SimpleControl
- Object
- Control
- SimpleControl
- ViewComponent::Storybook::Controls::BaseOptions
- Defined in:
- lib/view_component/storybook/controls/base_options.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 Control
#default, #description, #name, #param
Instance Method Summary collapse
-
#initialize(param, type:, options:, default: nil, labels: nil, name: nil, description: nil, **opts) ⇒ BaseOptions
constructor
A new instance of BaseOptions.
- #to_csf_params ⇒ Object
Methods inherited from SimpleControl
Methods inherited from Control
Constructor Details
#initialize(param, type:, options:, default: nil, labels: nil, name: nil, description: nil, **opts) ⇒ BaseOptions
Returns a new instance of BaseOptions.
11 12 13 14 15 16 |
# File 'lib/view_component/storybook/controls/base_options.rb', line 11 def initialize(param, type:, options:, default: nil, labels: nil, name: nil, description: nil, **opts) super(param, default: default, name: name, description: description, **opts) @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.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.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.rb', line 7 def type @type end |
Instance Method Details
#to_csf_params ⇒ Object
18 19 20 |
# File 'lib/view_component/storybook/controls/base_options.rb', line 18 def to_csf_params super.deep_merge(argTypes: { param => { options: } }) end |