Class: UI::SliderThumbComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- UI::SliderThumbComponent
- Includes:
- SliderThumbBehavior
- Defined in:
- app/view_components/ui/slider_thumb_component.rb
Overview
Slider Thumb component (ViewComponent) Draggable handle that controls the slider value
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(disabled: false, classes: "", attributes: {}) ⇒ SliderThumbComponent
constructor
A new instance of SliderThumbComponent.
Methods included from SliderThumbBehavior
Constructor Details
#initialize(disabled: false, classes: "", attributes: {}) ⇒ SliderThumbComponent
Returns a new instance of SliderThumbComponent.
18 19 20 21 22 |
# File 'app/view_components/ui/slider_thumb_component.rb', line 18 def initialize(disabled: false, classes: "", attributes: {}) @disabled = disabled @classes = classes @attributes = attributes end |
Instance Method Details
#call ⇒ Object
24 25 26 27 28 29 |
# File 'app/view_components/ui/slider_thumb_component.rb', line 24 def call attrs = attrs[:data] = attrs[:data].merge(@attributes.fetch(:data, {})) content_tag :div, "", **attrs.merge(@attributes.except(:data)) end |