Class: ViewComponent::Storybook::Controls::Color

Inherits:
SimpleControl show all
Defined in:
lib/view_component/storybook/controls/color.rb

Instance Attribute Summary collapse

Attributes inherited from Control

#default, #description, #name, #param

Instance Method Summary collapse

Methods inherited from SimpleControl

#parse_param_value, #to_csf_params

Methods inherited from Control

#parse_param_value, #to_csf_params

Constructor Details

#initialize(param, default: nil, preset_colors: nil, name: nil, description: nil, **opts) ⇒ Color

Returns a new instance of Color.



9
10
11
12
# File 'lib/view_component/storybook/controls/color.rb', line 9

def initialize(param, default: nil, preset_colors: nil, name: nil, description: nil, **opts)
  super(param, default: default, name: name, description: description, **opts)
  @preset_colors = preset_colors
end

Instance Attribute Details

#preset_colorsObject (readonly)

Returns the value of attribute preset_colors.



7
8
9
# File 'lib/view_component/storybook/controls/color.rb', line 7

def preset_colors
  @preset_colors
end

Instance Method Details

#typeObject



14
15
16
# File 'lib/view_component/storybook/controls/color.rb', line 14

def type
  :color
end