Class: Aureus::Components::ToolbarSection

Inherits:
Renderable
  • Object
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(position) ⇒ ToolbarSection

Returns a new instance of ToolbarSection.



27
28
29
30
# File 'lib/aureus/components/toolbar.rb', line 27

def initialize(position)
  @items = Array.new
  @position = position
end

Instance Method Details

Yields:

  • (toolbar)


36
37
38
39
40
# File 'lib/aureus/components/toolbar.rb', line 36

def dropdown(title)
  toolbar = ToolbarDropdown.new(title)
  yield toolbar
  @items << toolbar
end

#info(text) ⇒ Object



42
43
44
# File 'lib/aureus/components/toolbar.rb', line 42

def info(text)
  @items << ToolbarInfo.new(text,0)
end


32
33
34
# File 'lib/aureus/components/toolbar.rb', line 32

def link_to(text, url, *args)
  @items << ToolbarButton.new(text, 0, url, args)
end

#renderObject



46
47
48
# File 'lib/aureus/components/toolbar.rb', line 46

def render
   'ul', compact_render(*@items), class: @position
end