Class: Head::Sidebars::Category
Instance Method Summary
collapse
#initialize
Instance Method Details
#css_classes ⇒ Object
24
25
26
|
# File 'app/components/head/sidebars/category.rb', line 24
def css_classes
"c-head-sidebar__category #{'js-head-sidebar__category' if }"
end
|
#data ⇒ Object
32
33
34
35
36
|
# File 'app/components/head/sidebars/category.rb', line 32
def data
return unless
{ identifier: }
end
|
#icon_classes ⇒ Object
28
29
30
|
# File 'app/components/head/sidebars/category.rb', line 28
def icon_classes
"#{icon_class_prefix}#{icon.to_s.gsub('_', '-')} c-head-sidebar__category-icon"
end
|
#identifier ⇒ Object
46
47
48
|
# File 'app/components/head/sidebars/category.rb', line 46
def identifier
@identifier ||= SecureRandom.hex
end
|
38
39
40
|
# File 'app/components/head/sidebars/category.rb', line 38
def
url == '#'
end
|
#with_separator ⇒ Object
42
43
44
|
# File 'app/components/head/sidebars/category.rb', line 42
def with_separator
with_link(name: nil, icon: nil)
end
|