Class: Aureus::Components::Navigation
Instance Method Summary
collapse
Methods inherited from Renderable
#compact, #compact_render, #content_tag, #init
Constructor Details
#initialize {|_self| ... } ⇒ Navigation
Returns a new instance of Navigation.
4
5
6
7
8
|
# File 'lib/aureus/components/navigation.rb', line 4
def initialize
@title = ''
@buttons = Array.new
yield(self)
end
|
Instance Method Details
14
15
16
|
# File 'lib/aureus/components/navigation.rb', line 14
def button(content)
@buttons << NavigationButton.new(content)
end
|
#render ⇒ Object
18
19
20
21
22
|
# File 'lib/aureus/components/navigation.rb', line 18
def render
content_tag 'div', class: 'aureus-navigation' do
compact content_tag('h2', content_tag('span', @title)), content_tag('ul', compact_render(*@buttons), id: 'quicklinks')
end
end
|
#title(title) ⇒ Object
10
11
12
|
# File 'lib/aureus/components/navigation.rb', line 10
def title(title)
@title = title
end
|