Class: RefineryPagesMenu
- Inherits:
-
Liquid::Tag
- Object
- Liquid::Tag
- RefineryPagesMenu
- Defined in:
- app/liquid/tags/refinery_tags.rb
Instance Method Summary collapse
-
#initialize(tag_name, block, tokens) ⇒ RefineryPagesMenu
constructor
A new instance of RefineryPagesMenu.
- #render(context) ⇒ Object
Constructor Details
#initialize(tag_name, block, tokens) ⇒ RefineryPagesMenu
Returns a new instance of RefineryPagesMenu.
17 18 19 20 |
# File 'app/liquid/tags/refinery_tags.rb', line 17 def initialize(tag_name, block, tokens) super @name = block end |
Instance Method Details
#render(context) ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'app/liquid/tags/refinery_tags.rb', line 22 def render(context) if context['capture_variable'] context[context['capture_variable']] ||= context.registers[:action_view]..roots.inject([]) { |ary, | ary << Refinery::MenuItemDrop.new(); ary } else context['pages_roots'] ||= context.registers[:action_view]..roots.inject([]) { |ary, | ary << Refinery::MenuItemDrop.new(); ary } end '' end |