Class: PufferPages::Liquid::Tags::Super
- Inherits:
-
Liquid::Include
- Object
- Liquid::Include
- PufferPages::Liquid::Tags::Super
- Defined in:
- lib/puffer_pages/liquid/tags/super.rb
Instance Method Summary collapse
-
#initialize(tag_name, markup, tokens) ⇒ Super
constructor
A new instance of Super.
- #render(context) ⇒ Object
Constructor Details
#initialize(tag_name, markup, tokens) ⇒ Super
Returns a new instance of Super.
6 7 8 9 10 11 |
# File 'lib/puffer_pages/liquid/tags/super.rb', line 6 def initialize(tag_name, markup, tokens) @attributes = {} markup.scan(::Liquid::TagAttributes) do |key, value| @attributes[key] = value end end |
Instance Method Details
#render(context) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/puffer_pages/liquid/tags/super.rb', line 13 def render(context) source = _read_template_from_file_system(context) context.stack do @attributes.each do |key, value| context[key] = context[value] end source.render(context) end end |