Class: ViewComponent::Storybook::Controls::ColorConfig

Inherits:
SimpleControlConfig show all
Defined in:
lib/view_component/storybook/controls/color_config.rb

Instance Attribute Summary collapse

Attributes inherited from SimpleControlConfig

#default_value

Instance Method Summary collapse

Methods inherited from SimpleControlConfig

#to_csf_params, #value_from_params

Methods inherited from ControlConfig

#description, #name, #param, #prefix_param, #to_csf_params, #value_from_params

Constructor Details

#initialize(default_value, preset_colors: nil, param: nil, name: nil, description: nil) ⇒ ColorConfig

Returns a new instance of ColorConfig.



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

def initialize(default_value, preset_colors: nil, param: nil, name: nil, description: nil)
  super(default_value, param: param, name: name, description: description)
  @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_config.rb', line 7

def preset_colors
  @preset_colors
end

Instance Method Details

#typeObject



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

def type
  :color
end