Class: PufferPages::Liquid::Tags::Super

Inherits:
Liquid::Include
  • Object
show all
Defined in:
lib/puffer_pages/liquid/tags/super.rb

Instance Method Summary collapse

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