Class: JetUi::Popover::TriggerComponent

Inherits:
BaseComponent
  • Object
show all
Defined in:
app/components/jet_ui/popover/trigger_component.rb

Instance Method Summary collapse

Constructor Details

#initialize(as: nil, **options) ⇒ TriggerComponent

Returns a new instance of TriggerComponent.



6
7
8
9
# File 'app/components/jet_ui/popover/trigger_component.rb', line 6

def initialize(as: nil, **options)
  @as = as
  @options = options
end

Instance Method Details

#callObject



11
12
13
14
15
16
17
# File 'app/components/jet_ui/popover/trigger_component.rb', line 11

def call
  if @as
    helpers.jet_ui.public_send(@as, **@options) { content }
  else
     :span, content, **@options
  end
end