Class: ActionView::Storybook::Controls::BooleanConfig
Constant Summary
collapse
- BOOLEAN_VALUES =
[true, false].freeze
Instance Attribute Summary
#name, #param, #value
Instance Method Summary
collapse
#initialize, #to_csf_params
Instance Method Details
#type ⇒ Object
11
12
13
|
# File 'lib/action_view/storybook/controls/boolean_config.rb', line 11
def type
:boolean
end
|
#value_from_param(param) ⇒ Object
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/action_view/storybook/controls/boolean_config.rb', line 15
def value_from_param(param)
if param.is_a?(String) && param.present?
case param
when "true"
true
when "false"
false
end
else
super(param)
end
end
|