Class: ActionView::Storybook::Controls::ArrayConfig
- Inherits:
-
ControlConfig
- Object
- ControlConfig
- ActionView::Storybook::Controls::ArrayConfig
- Defined in:
- lib/action_view/storybook/controls/array_config.rb
Instance Attribute Summary collapse
-
#separator ⇒ Object
readonly
Returns the value of attribute separator.
Attributes inherited from ControlConfig
Instance Method Summary collapse
-
#initialize(param, value, separator = ",", name: nil) ⇒ ArrayConfig
constructor
A new instance of ArrayConfig.
- #type ⇒ Object
- #value_from_param(param) ⇒ Object
Methods inherited from ControlConfig
Constructor Details
#initialize(param, value, separator = ",", name: nil) ⇒ ArrayConfig
Returns a new instance of ArrayConfig.
11 12 13 14 |
# File 'lib/action_view/storybook/controls/array_config.rb', line 11 def initialize(param, value, separator = ",", name: nil) super(param, value, name: name) @separator = separator end |
Instance Attribute Details
#separator ⇒ Object (readonly)
Returns the value of attribute separator.
7 8 9 |
# File 'lib/action_view/storybook/controls/array_config.rb', line 7 def separator @separator end |
Instance Method Details
#type ⇒ Object
16 17 18 |
# File 'lib/action_view/storybook/controls/array_config.rb', line 16 def type :array end |
#value_from_param(param) ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/action_view/storybook/controls/array_config.rb', line 20 def value_from_param(param) if param.is_a?(String) param.split(separator) else super(param) end end |