Class: Impulse::Autocomplete::GroupComponent
- Inherits:
-
Impulse::ApplicationComponent
- Object
- ViewComponent::Base
- Impulse::ApplicationComponent
- Impulse::Autocomplete::GroupComponent
- Defined in:
- app/components/impulse/autocomplete/group_component.rb
Instance Method Summary collapse
-
#initialize(title:, **system_args) ⇒ GroupComponent
constructor
A new instance of GroupComponent.
- #render? ⇒ Boolean
Methods inherited from Impulse::ApplicationComponent
Methods included from Helpers::AttributesHelper
Constructor Details
#initialize(title:, **system_args) ⇒ GroupComponent
Returns a new instance of GroupComponent.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'app/components/impulse/autocomplete/group_component.rb', line 6 def initialize(title:, **system_args) @id = self.class.generate_id @title = title @system_args = system_args @system_args[:tag] = :div @system_args[:role] = :group @system_args["aria-labelledby"] = @id @system_args[:class] = class_names(system_args[:class], "awc-autocomplete-group") @system_args[:"data-text"] = title @system_args[:data] = merge_attributes( system_args[:data], target: "awc-autocomplete.groups" ) end |
Instance Method Details
#render? ⇒ Boolean
22 23 24 |
# File 'app/components/impulse/autocomplete/group_component.rb', line 22 def render? .present? end |