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.



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

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

Instance Method Details

Yields:

  • (toolbar)


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

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

#info(text) ⇒ Object



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

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


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

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

#renderObject



50
51
52
# File 'lib/aureus/components/toolbar.rb', line 50

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