Class: Aureus::Components::Toolbar
Instance Method Summary
collapse
Methods inherited from Renderable
#compact, #compact_render, #content_tag, #init
Constructor Details
#initialize(title) {|_self| ... } ⇒ Toolbar
Returns a new instance of Toolbar.
4
5
6
7
8
9
|
# File 'lib/aureus/components/toolbar.rb', line 4
def initialize(title)
@title = title
@left = ToolbarSection.new 'left'
@right = ToolbarSection.new 'right'
yield(self)
end
|
Instance Method Details
#left {|@left| ... } ⇒ Object
11
12
13
|
# File 'lib/aureus/components/toolbar.rb', line 11
def left
yield @left
end
|
#render ⇒ Object
19
20
21
22
23
|
# File 'lib/aureus/components/toolbar.rb', line 19
def render
content_tag 'div', { class: 'aureus-toolbar' } do
compact content_tag('h1', @title), @left.render, @right.render
end
end
|
#right {|@right| ... } ⇒ Object
15
16
17
|
# File 'lib/aureus/components/toolbar.rb', line 15
def right
yield @right
end
|