Class: Impulse::AnchorComponent

Inherits:
ApplicationComponent show all
Defined in:
app/components/impulse/anchor_component.rb

Instance Method Summary collapse

Methods inherited from ApplicationComponent

generate_id

Methods included from Helpers::AttributesHelper

#merge_attributes

Constructor Details

#initialize(fallback_placements: [], **system_args) ⇒ AnchorComponent

Returns a new instance of AnchorComponent.



3
4
5
6
7
# File 'app/components/impulse/anchor_component.rb', line 3

def initialize(fallback_placements: [], **system_args)
  @system_args = system_args
  @system_args[:tag] = :"awc-anchor"
  @system_args[:"fallback-placements"] = fallback_placements.to_json
end

Instance Method Details

#callObject



9
10
11
# File 'app/components/impulse/anchor_component.rb', line 9

def call
  render(Impulse::BaseRenderer.new(**@system_args)) { content }
end