Class: Liquid::CustomBlocks::NestedContextBlock
- Inherits:
-
Block
- Object
- Block
- Liquid::CustomBlocks::NestedContextBlock
- Defined in:
- lib/liquid/custom_blocks/nested_context_block.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(tag_name, markup, tokens) ⇒ NestedContextBlock
constructor
A new instance of NestedContextBlock.
- #render(context) ⇒ Object
Constructor Details
#initialize(tag_name, markup, tokens) ⇒ NestedContextBlock
Returns a new instance of NestedContextBlock.
8 9 10 11 |
# File 'lib/liquid/custom_blocks/nested_context_block.rb', line 8 def initialize(tag_name, markup, tokens) super @context_file_variable, @context_name = markup.split(",").map(&:strip) end |
Instance Method Details
#render(context) ⇒ Object
13 14 15 16 17 |
# File 'lib/liquid/custom_blocks/nested_context_block.rb', line 13 def render(context) context_file = context[@context_file_variable].to_s.strip context[@context_name] = load_content(context_file) super end |