Class: Bop::Tags::Yield

Inherits:
Liquid::Tag
  • Object
show all
Defined in:
lib/bop/tags.rb

Instance Method Summary collapse

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