Class: SemanticMenu
Instance Attribute Summary
Attributes inherited from MenuItem
Instance Method Summary (collapse)
-
- (SemanticMenu) initialize(controller, opts = {}) {|_self| ... }
constructor
A new instance of SemanticMenu.
- - (Object) to_s
Methods inherited from MenuItem
#active?, #add, #child_output, #level_class, #on_current_page?
Constructor Details
- (SemanticMenu) initialize(controller, opts = {}) {|_self| ... }
A new instance of SemanticMenu
48 49 50 51 52 53 54 55 |
# File 'lib/semantic_menu.rb', line 48 def initialize(controller, opts={},&block) @@controller = controller @opts = {:class => 'menu'}.merge opts @level = 0 @children = [] yield self if block_given? end |
Instance Method Details
- (Object) to_s
57 58 59 |
# File 'lib/semantic_menu.rb', line 57 def to_s content_tag(:ul, @children.collect(&:to_s).join, @opts) end |