Class: JetUi::Tooltip::Component
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- BaseComponent
- JetUi::Tooltip::Component
- Defined in:
- app/components/jet_ui/tooltip/component.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(title:, as: nil, placement: :top, **options) ⇒ Component
constructor
A new instance of Component.
Constructor Details
#initialize(title:, as: nil, placement: :top, **options) ⇒ Component
Returns a new instance of Component.
6 7 8 9 10 11 |
# File 'app/components/jet_ui/tooltip/component.rb', line 6 def initialize(title:, as: nil, placement: :top, **) @as = as @title = title @placement = placement @options = end |
Instance Method Details
#call ⇒ Object
13 14 15 16 17 18 19 |
# File 'app/components/jet_ui/tooltip/component.rb', line 13 def call if @as helpers.jet_ui.public_send(@as, **attrs) { content } else content_tag :span, content, class: 'w-fit', **attrs end end |