Class: TwitterBootstrapBuilder::Builders::DropDownBuilder
- Inherits:
-
Base
- Object
- Base
- TwitterBootstrapBuilder::Builders::DropDownBuilder
show all
- Defined in:
- lib/twitter_bootstrap_builder/builders/drop_down_builder.rb
Instance Attribute Summary
Attributes inherited from Base
#block, #options, #template
Instance Method Summary
collapse
Methods inherited from Base
#html_safe, #initialize
Instance Method Details
#link_to(*args, &block) ⇒ Object
14
15
16
|
# File 'lib/twitter_bootstrap_builder/builders/drop_down_builder.rb', line 14
def link_to(*args, &block)
Tag.block(:li, template.link_to(*args, &block)).html_safe
end
|
#to_s ⇒ Object
5
6
7
8
9
10
11
12
|
# File 'lib/twitter_bootstrap_builder/builders/drop_down_builder.rb', line 5
def to_s
dropdown = self.dropdown_class.new(options[:text])
dropdown.append template.capture(self, &block) if block
dropdown.send(options[:type]) if options[:type] && dropdown.respond_to?(options[:type])
dropdown.send(options[:size]) if options[:size] && dropdown.respond_to?(options[:size])
dropdown.as_nav_item if dropdown.respond_to? :as_nav_item
dropdown.to_s
end
|