class Liquid::Pry::Tag

Interrupts rendering, allowing user to inspect or modify the context.

@example

{% pry %}

Attributes

once[R]
visited[R]

Public Class Methods

new(tag_name, text, tokens) click to toggle source
Calls superclass method
# File lib/liquid/pry/tag.rb, line 14
def initialize(tag_name, text, tokens)
  super
  @visited = false
  parse_args(text)
end

Public Instance Methods

parse_args(args_str) click to toggle source
# File lib/liquid/pry/tag.rb, line 20
def parse_args(args_str)
  case args_str.strip
  when ""
    return
  when "once"
    set_once
  else
    raise(
      ArgumentError,
      "Arguments passed to pry tag could not be recognized: #{args_str}",
    )
  end
end
render(context) click to toggle source
# File lib/liquid/pry/tag.rb, line 38
def render(context)
  binding.pry unless once && visited
  @visited = true
  ""
end
set_once() click to toggle source
# File lib/liquid/pry/tag.rb, line 34
def set_once
  @once = true
end