Class: Liquid::Raw
Constant Summary collapse
Constants inherited from Block
Instance Attribute Summary
Attributes inherited from Tag
#line_number, #parse_context, #tag_name
Instance Method Summary collapse
- #blank? ⇒ Boolean
-
#initialize(tag_name, markup, parse_context) ⇒ Raw
constructor
A new instance of Raw.
- #nodelist ⇒ Object
- #parse(tokens) ⇒ Object
- #render_to_output_buffer(_context, output) ⇒ Object
Methods inherited from Block
#block_delimiter, #block_name, #raise_tag_never_closed, raise_unknown_tag, #render, #unknown_tag
Methods inherited from Tag
disable_tags, #name, parse, #raw, #render
Methods included from ParserSwitching
#parse_with_selected_parser, #strict_parse_with_error_mode_fallback
Constructor Details
#initialize(tag_name, markup, parse_context) ⇒ Raw
Returns a new instance of Raw.
8 9 10 11 12 |
# File 'lib/liquid/tags/raw.rb', line 8 def initialize(tag_name, markup, parse_context) super ensure_valid_markup(tag_name, markup, parse_context) end |
Instance Method Details
#blank? ⇒ Boolean
36 37 38 |
# File 'lib/liquid/tags/raw.rb', line 36 def blank? @body.empty? end |
#nodelist ⇒ Object
32 33 34 |
# File 'lib/liquid/tags/raw.rb', line 32 def nodelist [@body] end |
#parse(tokens) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/liquid/tags/raw.rb', line 14 def parse(tokens) @body = +'' while (token = tokens.shift) if token =~ FullTokenPossiblyInvalid && block_delimiter == Regexp.last_match(2) @body << Regexp.last_match(1) if Regexp.last_match(1) != "" return end @body << token unless token.empty? end raise_tag_never_closed(block_name) end |
#render_to_output_buffer(_context, output) ⇒ Object
27 28 29 30 |
# File 'lib/liquid/tags/raw.rb', line 27 def render_to_output_buffer(_context, output) output << @body output end |