Class: Impulse::AnchorComponent
- Inherits:
-
ApplicationComponent
- Object
- ViewComponent::Base
- ApplicationComponent
- Impulse::AnchorComponent
- Defined in:
- app/components/impulse/anchor_component.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(fallback_placements: [], **system_args) ⇒ AnchorComponent
constructor
A new instance of AnchorComponent.
Methods inherited from ApplicationComponent
Methods included from Helpers::AttributesHelper
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
#call ⇒ Object
9 10 11 |
# File 'app/components/impulse/anchor_component.rb', line 9 def call render(Impulse::BaseRenderer.new(**@system_args)) { content } end |