Class: Tabit::Builder
Instance Attribute Summary
Attributes inherited from Item
#active, #name, #options, #type, #url
Instance Method Summary collapse
- #children ⇒ Object
-
#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.
27 28 29 30 31 32 |
# File 'lib/tabit/builder.rb', line 27 def initialize(template, ) self.template = template self. = yield self if block_given? end |
Instance Method Details
#children ⇒ Object
46 47 48 |
# File 'lib/tabit/builder.rb', line 46 def children @children ||= [] end |
#to_s ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/tabit/builder.rb', line 34 def to_s = .delete :outer .delete :inner template.content_tag( :ul, children.collect(&:to_s).join.html_safe, ) end |