Class: Spark::Nav::Tree::Group
- Inherits:
-
Group
- Object
- ActionView::Component::Base
- Component::Base
- Group
- Spark::Nav::Tree::Group
- Defined in:
- app/components/spark/nav/tree/group.rb
Instance Method Summary collapse
- #expanded? ⇒ Boolean
-
#initialize ⇒ Group
constructor
A new instance of Group.
- #node ⇒ Object
Methods inherited from Group
#active?, #active_item, #beta?, #new?
Methods inherited from Component::Base
Constructor Details
#initialize ⇒ Group
Returns a new instance of Group.
9 10 11 12 13 14 |
# File 'app/components/spark/nav/tree/group.rb', line 9 def initialize(*) super classname.base = "nav-item-wrapper" tag_attrs.add(role: :treeitem) end |
Instance Method Details
#expanded? ⇒ Boolean
20 21 22 |
# File 'app/components/spark/nav/tree/group.rb', line 20 def @expanded || active? end |
#node ⇒ Object
16 17 18 |
# File 'app/components/spark/nav/tree/group.rb', line 16 def node @title.to_s.strip.downcase.gsub(/[\W,-]+/, '_') end |