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