Class: Bop::Tags::Yield
- Inherits:
-
Liquid::Tag
- Object
- Liquid::Tag
- Bop::Tags::Yield
- Defined in:
- lib/bop/tags.rb
Instance Method Summary collapse
-
#initialize(tag_name, bucket, tokens) ⇒ Yield
constructor
A new instance of Yield.
- #render(context) ⇒ Object
Constructor Details
#initialize(tag_name, bucket, tokens) ⇒ Yield
Returns a new instance of Yield.
7 8 9 10 |
# File 'lib/bop/tags.rb', line 7 def initialize(tag_name, bucket, tokens) super @bucket = bucket || "main" end |
Instance Method Details
#render(context) ⇒ Object
12 13 14 15 16 17 |
# File 'lib/bop/tags.rb', line 12 def render(context) if page = context[:page] block_context = context.dup.merge(:block => self) page.blocks_for(@bucket.downcase).map{ |block| block.render(block_context) } end end |