Class: Trestle::Toolbar::Builder
- Inherits:
-
Object
- Object
- Trestle::Toolbar::Builder
show all
- Defined in:
- lib/trestle/toolbar/builder.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(template) ⇒ Builder
Returns a new instance of Builder.
4
5
6
|
# File 'lib/trestle/toolbar/builder.rb', line 4
def initialize(template)
@template = template
end
|
Class Method Details
.builder_method(*methods) ⇒ Object
26
27
28
|
# File 'lib/trestle/toolbar/builder.rb', line 26
def self.builder_method(*methods)
self.builder_methods += methods
end
|
Instance Method Details
8
9
10
|
# File 'lib/trestle/toolbar/builder.rb', line 8
def button(label, options={}, &block)
Button.new(@template, label, options, &block)
end
|
#dropdown(label = nil, options = {}, &block) ⇒ Object
16
17
18
|
# File 'lib/trestle/toolbar/builder.rb', line 16
def dropdown(label=nil, options={}, &block)
Dropdown.new(@template, label, options, &block)
end
|
#link(label, instance_or_url = {}, options = {}, &block) ⇒ Object
12
13
14
|
# File 'lib/trestle/toolbar/builder.rb', line 12
def link(label, instance_or_url={}, options={}, &block)
Link.new(@template, label, instance_or_url, options, &block)
end
|