Class: Zwite::Liquid::Block
- Defined in:
- lib/zwite/liquid/block.rb
Constant Summary collapse
- Syntax =
/(\w+)/
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(tag_name, markup, tokens) ⇒ Block
constructor
A new instance of Block.
- #render(context) ⇒ Object
Constructor Details
#initialize(tag_name, markup, tokens) ⇒ Block
Returns a new instance of Block.
10 11 12 13 14 15 16 17 |
# File 'lib/zwite/liquid/block.rb', line 10 def initialize(tag_name, markup, tokens) if markup =~ Syntax @name = $1 else raise SyntaxError.new("Syntax Error in 'block' - Valid syntax {% block [name] %}{% endblock %}") end super end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/zwite/liquid/block.rb', line 8 def name @name end |
Instance Method Details
#render(context) ⇒ Object
19 20 21 22 23 |
# File 'lib/zwite/liquid/block.rb', line 19 def render(context) context.stack do render_all(@nodelist, context) end end |