Class: Aureus::ToolbarSection

Inherits:
Renderable show all
Defined in:
lib/aureus/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.



29
30
31
32
# File 'lib/aureus/toolbar.rb', line 29

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

Instance Method Details

#info(text) ⇒ Object



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

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


34
35
36
# File 'lib/aureus/toolbar.rb', line 34

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

#renderObject



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

def render
   "ul", compact_render(*@items), :class => @position
end