mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-19 10:52:48 -07:00
Refactor to create tags with a parse class method instead of new.
By moving parse out of the initializer, we can call super at the start of the initializers for subclasses, and avoid the nasty allocate hack.
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
module Liquid
|
||||
class Document < Block
|
||||
# we don't need markup to open this block
|
||||
def initialize(tokens, options = {})
|
||||
@options = options
|
||||
parse(tokens)
|
||||
def self.parse(tokens, options={})
|
||||
# we don't need markup to open this block
|
||||
super(nil, nil, tokens, options)
|
||||
end
|
||||
|
||||
# There isn't a real delimiter
|
||||
|
||||
Reference in New Issue
Block a user