Class: UI::DrawerHandleComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- UI::DrawerHandleComponent
- Includes:
- DrawerHandleBehavior
- Defined in:
- app/view_components/ui/drawer_handle_component.rb
Overview
Drawer handle component (ViewComponent) Visual affordance for drag gesture (shown on bottom/top drawers only)
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(classes: "", attributes: {}) ⇒ DrawerHandleComponent
constructor
A new instance of DrawerHandleComponent.
Methods included from DrawerHandleBehavior
#drawer_handle_classes, #drawer_handle_container_base_classes, #drawer_handle_data_attributes, #drawer_handle_html_attributes
Constructor Details
#initialize(classes: "", attributes: {}) ⇒ DrawerHandleComponent
Returns a new instance of DrawerHandleComponent.
13 14 15 16 |
# File 'app/view_components/ui/drawer_handle_component.rb', line 13 def initialize(classes: "", attributes: {}) @classes = classes @attributes = attributes end |
Instance Method Details
#call ⇒ Object
18 19 20 21 22 23 |
# File 'app/view_components/ui/drawer_handle_component.rb', line 18 def call attrs = drawer_handle_html_attributes attrs[:data] = attrs[:data].merge(@attributes.fetch(:data, {})) content_tag :div, "", **attrs.merge(@attributes.except(:data)) end |