Class: ViewComponent::Storybook::Controls::Control
- Inherits:
-
Object
- Object
- ViewComponent::Storybook::Controls::Control
- Includes:
- ActiveModel::Validations
- Defined in:
- lib/view_component/storybook/controls/control.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#default ⇒ Object
readonly
Returns the value of attribute default.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#param ⇒ Object
readonly
Returns the value of attribute param.
Instance Method Summary collapse
-
#initialize(param, default:, name: nil, description: nil) ⇒ Control
constructor
A new instance of Control.
- #parse_param_value(value) ⇒ Object
- #to_csf_params ⇒ Object
Constructor Details
#initialize(param, default:, name: nil, description: nil) ⇒ Control
Returns a new instance of Control.
13 14 15 16 17 18 |
# File 'lib/view_component/storybook/controls/control.rb', line 13 def initialize(param, default:, name: nil, description: nil) @param = param @default = default @name = name || param.to_s.humanize.titlecase @description = description end |
Instance Attribute Details
#default ⇒ Object (readonly)
Returns the value of attribute default.
11 12 13 |
# File 'lib/view_component/storybook/controls/control.rb', line 11 def default @default end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
11 12 13 |
# File 'lib/view_component/storybook/controls/control.rb', line 11 def description @description end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
11 12 13 |
# File 'lib/view_component/storybook/controls/control.rb', line 11 def name @name end |
#param ⇒ Object (readonly)
Returns the value of attribute param.
11 12 13 |
# File 'lib/view_component/storybook/controls/control.rb', line 11 def param @param end |
Instance Method Details
#parse_param_value(value) ⇒ Object
26 27 28 29 30 |
# File 'lib/view_component/storybook/controls/control.rb', line 26 def parse_param_value(value) # :nocov: raise NotImplementedError # :nocov: end |
#to_csf_params ⇒ Object
20 21 22 23 24 |
# File 'lib/view_component/storybook/controls/control.rb', line 20 def to_csf_params # :nocov: raise NotImplementedError # :nocov: end |