class Liquid::Raw
Constants
- FullTokenPossiblyInvalid
- Syntax
Public Class Methods
new(tag_name, markup, parse_context)
click to toggle source
Calls superclass method
Liquid::Block::new
# File lib/liquid/tags/raw.rb, line 6 def initialize(tag_name, markup, parse_context) super ensure_valid_markup(tag_name, markup, parse_context) end
Public Instance Methods
blank?()
click to toggle source
# File lib/liquid/tags/raw.rb, line 33 def blank? @body.empty? end
nodelist()
click to toggle source
# File lib/liquid/tags/raw.rb, line 29 def nodelist [@body] end
parse(tokens)
click to toggle source
# File lib/liquid/tags/raw.rb, line 12 def parse(tokens) @body = '' while token = tokens.shift if token =~ FullTokenPossiblyInvalid @body << $1 if $1 != "".freeze return if block_delimiter == $2 end @body << token unless token.empty? end raise SyntaxError.new(parse_context.locale.t("errors.syntax.tag_never_closed".freeze, block_name: block_name)) end
render(_context)
click to toggle source
# File lib/liquid/tags/raw.rb, line 25 def render(_context) @body end
Protected Instance Methods
ensure_valid_markup(tag_name, markup, parse_context)
click to toggle source
# File lib/liquid/tags/raw.rb, line 39 def ensure_valid_markup(tag_name, markup, parse_context) unless markup =~ Syntax raise SyntaxError.new(parse_context.locale.t("errors.syntax.tag_unexpected_args".freeze, tag: tag_name)) end end