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