Class: Spark::Nav::Group
Instance Method Summary
collapse
#selector, #to_s, #unique_id
Constructor Details
#initialize ⇒ Group
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
26
27
28
|
# File 'app/components/spark/nav/group.rb', line 26
def active?
items.any?(&:active?)
end
|
#active_item ⇒ Object
22
23
24
|
# File 'app/components/spark/nav/group.rb', line 22
def active_item
items.find(&:active?)
end
|
#beta? ⇒ Boolean
18
19
20
|
# File 'app/components/spark/nav/group.rb', line 18
def beta?
items.any?(&:beta?)
end
|
#new? ⇒ Boolean
14
15
16
|
# File 'app/components/spark/nav/group.rb', line 14
def new?
items.any?(&:new?)
end
|