Class: Spark::Nav::Group

Inherits:
Component::Base show all
Defined in:
app/components/spark/nav/group.rb

Direct Known Subclasses

Tree::Group

Instance Method Summary collapse

Methods inherited from Component::Base

#selector, #to_s, #unique_id

Constructor Details

#initializeGroup

Returns a new instance of Group.



8
9
10
11
12
# File 'app/components/spark/nav/group.rb', line 8

def initialize(*)
  super

  classname.add("active") if active?
end

Instance Method Details

#active?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'app/components/spark/nav/group.rb', line 26

def active?
  items.any?(&:active?)
end

#active_itemObject



22
23
24
# File 'app/components/spark/nav/group.rb', line 22

def active_item
  items.find(&:active?)
end

#beta?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'app/components/spark/nav/group.rb', line 18

def beta?
  items.any?(&:beta?)
end

#new?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'app/components/spark/nav/group.rb', line 14

def new?
  items.any?(&:new?)
end