Move the parse method out of Tag, only blocks need the body parsed.

The parse method should be renamed to something like parse_body,
since that is how it is used, and no non-block tags were using the
parse method.
This commit is contained in:
Dylan Thacker-Smith
2014-02-27 22:29:04 -05:00
parent f89046e81f
commit 7eb64886dc
3 changed files with 5 additions and 7 deletions

View File

@@ -5,6 +5,11 @@ module Liquid
FullToken = /\A#{TagStart}\s*(\w+)\s*(.*)?#{TagEnd}\z/o
ContentOfVariable = /\A#{VariableStart}(.*)#{VariableEnd}\z/o
def initialize(tag_name, markup, tokens)
super
parse(tokens)
end
def blank?
@blank || false
end

View File

@@ -16,10 +16,6 @@ module Liquid
@tag_name = tag_name
@markup = markup
@options ||= {} # needs || because might be set before initialize
parse(tokens)
end
def parse(tokens)
end
def name

View File

@@ -35,9 +35,6 @@ module Liquid
super
end
def parse(tokens)
end
def blank?
false
end