Class: Tabit::Builder
Instance Attribute Summary
Attributes inherited from Item
#active, #children, #name, #options, #url
Instance Method Summary collapse
-
#initialize(template, options) {|_self| ... } ⇒ Builder
constructor
A new instance of Builder.
- #to_s ⇒ Object
Methods inherited from Item
#active?, #add, #divider, #heading
Constructor Details
#initialize(template, options) {|_self| ... } ⇒ Builder
Returns a new instance of Builder.
4 5 6 7 8 9 10 11 |
# File 'lib/tabit/builder.rb', line 4 def initialize(template, , &block) @@template = template @children = [] = yield self if block_given? end |
Instance Method Details
#to_s ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/tabit/builder.rb', line 13 def to_s template.content_tag( :ul, children.collect(&:to_s).join.html_safe, ) end |