Class: ViewComponent::Storybook::Controls::Boolean
- Inherits:
-
SimpleControl
- Object
- Control
- SimpleControl
- ViewComponent::Storybook::Controls::Boolean
- Defined in:
- lib/view_component/storybook/controls/boolean.rb
Constant Summary collapse
- BOOLEAN_VALUES =
[true, false].freeze
Instance Attribute Summary
Attributes inherited from Control
#default, #description, #name, #param
Instance Method Summary collapse
Methods inherited from SimpleControl
Methods inherited from Control
Constructor Details
This class inherits a constructor from ViewComponent::Storybook::Controls::SimpleControl
Instance Method Details
#parse_param_value(value) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/view_component/storybook/controls/boolean.rb', line 15 def parse_param_value(value) if value.is_a?(String) && value.present? case value when "true" true when "false" false end else value end end |
#type ⇒ Object
11 12 13 |
# File 'lib/view_component/storybook/controls/boolean.rb', line 11 def type :boolean end |