Class: Aureus::Components::Toolbar

Inherits:
Renderable show all
Defined in:
lib/aureus/components/toolbar.rb

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

Yields:



13
14
15
# File 'lib/aureus/components/toolbar.rb', line 13

def left
  yield @left
end

#renderObject



21
22
23
24
25
# File 'lib/aureus/components/toolbar.rb', line 21

def render
   'div', { class: 'aureus-toolbar' } do
    compact ('h1',@title), @left.render, @right.render
  end
end

#right {|@right| ... } ⇒ Object

Yields:



17
18
19
# File 'lib/aureus/components/toolbar.rb', line 17

def right
  yield @right
end