Class: Pulse::NavList::Heading
- Defined in:
- app/components/pulse/nav_list/heading.rb
Overview
The heading placed above a NavList's items.
See <%= link_to_component(NavList) %> for usage examples.
Constant Summary
Constants inherited from Component
Constants included from AttributesHelper
AttributesHelper::PLURAL_ARIA_ATTRIBUTES, AttributesHelper::PLURAL_DATA_ATTRIBUTES
Instance Attribute Summary collapse
-
#heading_level ⇒ Object
readonly
Returns the value of attribute heading_level.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#system_arguments ⇒ Object
readonly
Returns the value of attribute system_arguments.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(title:, id: self.class.generate_id, heading_level: 2, **system_arguments) ⇒ Heading
constructor
A new instance of Heading.
Methods inherited from Component
generate_id, #merge_attributes, #merge_classes
Methods included from SvgHelper
Methods included from FetchOrFallbackHelper
#fetch_or_fallback, #fetch_or_fallback_boolean
Methods included from AttributesHelper
#aria, #data, #merge_aria, #merge_data, #merge_prefixed_attribute_hashes
Constructor Details
#initialize(title:, id: self.class.generate_id, heading_level: 2, **system_arguments) ⇒ Heading
Returns a new instance of Heading.
15 16 17 18 19 20 21 |
# File 'app/components/pulse/nav_list/heading.rb', line 15 def initialize(title:, id: self.class.generate_id, heading_level: 2, **system_arguments) @title = title @id = id @heading_level = heading_level @system_arguments = system_arguments end |
Instance Attribute Details
#heading_level ⇒ Object (readonly)
Returns the value of attribute heading_level.
9 10 11 |
# File 'app/components/pulse/nav_list/heading.rb', line 9 def heading_level @heading_level end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
9 10 11 |
# File 'app/components/pulse/nav_list/heading.rb', line 9 def id @id end |
#system_arguments ⇒ Object (readonly)
Returns the value of attribute system_arguments.
9 10 11 |
# File 'app/components/pulse/nav_list/heading.rb', line 9 def system_arguments @system_arguments end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
9 10 11 |
# File 'app/components/pulse/nav_list/heading.rb', line 9 def title @title end |