class Liquid::Tag

Attributes

line_number[R]
nodelist[R]
options[R]
parse_context[R]
tag_name[R]

Public Class Methods

disable_tags(*tags) click to toggle source
# File lib/liquid-render-tag/tag.rb, line 16
def disable_tags(*tags)
  disabled_tags.push(*tags)
end
disabled_tags() click to toggle source
# File lib/liquid-render-tag/tag.rb, line 22
def disabled_tags
  @disabled_tags ||= []
end
new(tag_name, markup, parse_context) click to toggle source
# File lib/liquid-render-tag/tag.rb, line 27
def initialize(tag_name, markup, parse_context)
  @tag_name      = tag_name
  @markup        = markup
  @parse_context = parse_context
  @line_number   = parse_context.line_number
end
parse(tag_name, markup, tokenizer, parse_context) click to toggle source
# File lib/liquid-render-tag/tag.rb, line 10
def parse(tag_name, markup, tokenizer, parse_context)
  tag = new(tag_name, markup, parse_context)
  tag.parse(tokenizer)
  tag
end

Public Instance Methods

blank?() click to toggle source
# File lib/liquid-render-tag/tag.rb, line 65
def blank?
  false
end
disabled?(context) click to toggle source
# File lib/liquid-render-tag/tag.rb, line 49
def disabled?(context)
  context.registers[:disabled_tags].disabled?(tag_name)
end
disabled_error_message() click to toggle source
# File lib/liquid-render-tag/tag.rb, line 53
def disabled_error_message
  "#{tag_name} #{options[:locale].t('errors.disabled.tag')}"
end
disabled_tags() click to toggle source
# File lib/liquid-render-tag/tag.rb, line 69
def disabled_tags
  self.class.disabled_tags
end
name() click to toggle source
# File lib/liquid-render-tag/tag.rb, line 41
def name
  self.class.name.downcase
end
parse(_tokens) click to toggle source
# File lib/liquid-render-tag/tag.rb, line 34
def parse(_tokens)
end
raw() click to toggle source
# File lib/liquid-render-tag/tag.rb, line 37
def raw
  "#{@tag_name} #{@markup}"
end
render(_context) click to toggle source
# File lib/liquid-render-tag/tag.rb, line 45
def render(_context)
  ''
end
render_to_output_buffer(context, output) click to toggle source

For backwards compatibility with custom tags. In a future release, the semantics of the `render_to_output_buffer` method will become the default and the `render` method will be removed.

# File lib/liquid-render-tag/tag.rb, line 60
def render_to_output_buffer(context, output)
  output << render(context)
  output
end