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) {|_self| ... } ⇒ Toolbar

Returns a new instance of Toolbar.

Yields:

  • (_self)

Yield Parameters:



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

Yields:



11
12
13
# File 'lib/aureus/components/toolbar.rb', line 11

def left
  yield @left
end

#renderObject



19
20
21
22
23
# File 'lib/aureus/components/toolbar.rb', line 19

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

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

Yields:



15
16
17
# File 'lib/aureus/components/toolbar.rb', line 15

def right
  yield @right
end