From 23cadd6240e529495430c3390200e5e86c2035ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-Olivier=20B=C3=A9dard?= Date: Wed, 19 Jan 2022 22:02:37 -0500 Subject: [PATCH] Prototype: Dump yardoc to json --- liquid.gemspec | 1 + schema.json | 36345 ++++++++++++++++++++++ templates/content/fulldoc/json/setup.rb | 102 + 3 files changed, 36448 insertions(+) create mode 100644 schema.json create mode 100644 templates/content/fulldoc/json/setup.rb diff --git a/liquid.gemspec b/liquid.gemspec index bb668f59..4974c7eb 100644 --- a/liquid.gemspec +++ b/liquid.gemspec @@ -31,4 +31,5 @@ Gem::Specification.new do |s| s.add_development_dependency('rake', '~> 13.0') s.add_development_dependency('minitest') + s.add_development_dependency('yard') end diff --git a/schema.json b/schema.json new file mode 100644 index 00000000..00976ce2 --- /dev/null +++ b/schema.json @@ -0,0 +1,36345 @@ +[ + { + "type": "YARD::CodeObjects::RootObject", + "name": "root", + "namespace_type": null, + "namespace_name": null, + "files": [ + + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": null, + "tags": [ + + ] + }, + { + "type": "YARD::CodeObjects::ModuleObject", + "name": "Liquid", + "namespace_type": "YARD::CodeObjects::RootObject", + "namespace_name": "root", + "files": [ + [ + "lib/liquid.rb", + 24 + ], + [ + "lib/liquid/tag.rb", + 3 + ], + [ + "lib/liquid/drop.rb", + 5 + ], + [ + "lib/liquid/i18n.rb", + 5 + ], + [ + "lib/liquid/block.rb", + 3 + ], + [ + "lib/liquid/lexer.rb", + 4 + ], + [ + "lib/liquid/usage.rb", + 3 + ], + [ + "lib/liquid/utils.rb", + 3 + ], + [ + "lib/liquid/errors.rb", + 3 + ], + [ + "lib/liquid/parser.rb", + 3 + ], + [ + "lib/liquid/context.rb", + 3 + ], + [ + "lib/liquid/tags/if.rb", + 3 + ], + [ + "lib/liquid/version.rb", + 4 + ], + [ + "lib/liquid/document.rb", + 3 + ], + [ + "lib/liquid/profiler.rb", + 5 + ], + [ + "lib/liquid/register.rb", + 3 + ], + [ + "lib/liquid/tags/for.rb", + 3 + ], + [ + "lib/liquid/tags/raw.rb", + 3 + ], + [ + "lib/liquid/template.rb", + 3 + ], + [ + "lib/liquid/variable.rb", + 3 + ], + [ + "lib/liquid/condition.rb", + 3 + ], + [ + "lib/liquid/tags/case.rb", + 3 + ], + [ + "lib/liquid/tags/echo.rb", + 3 + ], + [ + "lib/liquid/tokenizer.rb", + 3 + ], + [ + "lib/liquid/block_body.rb", + 5 + ], + [ + "lib/liquid/expression.rb", + 3 + ], + [ + "lib/liquid/interrupts.rb", + 3 + ], + [ + "lib/liquid/tags/break.rb", + 3 + ], + [ + "lib/liquid/tags/cycle.rb", + 3 + ], + [ + "lib/liquid/file_system.rb", + 3 + ], + [ + "lib/liquid/tags/assign.rb", + 3 + ], + [ + "lib/liquid/tags/render.rb", + 3 + ], + [ + "lib/liquid/tags/unless.rb", + 5 + ], + [ + "lib/liquid/forloop_drop.rb", + 3 + ], + [ + "lib/liquid/range_lookup.rb", + 3 + ], + [ + "lib/liquid/tag/disabler.rb", + 3 + ], + [ + "lib/liquid/tags/capture.rb", + 3 + ], + [ + "lib/liquid/tags/comment.rb", + 3 + ], + [ + "lib/liquid/tags/include.rb", + 3 + ], + [ + "lib/liquid/parse_context.rb", + 3 + ], + [ + "lib/liquid/partial_cache.rb", + 3 + ], + [ + "lib/liquid/tags/continue.rb", + 3 + ], + [ + "lib/liquid/profiler/hooks.rb", + 3 + ], + [ + "lib/liquid/tags/decrement.rb", + 3 + ], + [ + "lib/liquid/tags/ifchanged.rb", + 3 + ], + [ + "lib/liquid/tags/increment.rb", + 3 + ], + [ + "lib/liquid/tags/table_row.rb", + 3 + ], + [ + "lib/liquid/resource_limits.rb", + 3 + ], + [ + "lib/liquid/standardfilters.rb", + 7 + ], + [ + "lib/liquid/tag/disableable.rb", + 3 + ], + [ + "lib/liquid/variable_lookup.rb", + 3 + ], + [ + "lib/liquid/parser_switching.rb", + 3 + ], + [ + "lib/liquid/static_registers.rb", + 3 + ], + [ + "lib/liquid/strainer_factory.rb", + 3 + ], + [ + "lib/liquid/template_factory.rb", + 3 + ], + [ + "lib/liquid/strainer_template.rb", + 5 + ], + [ + "lib/liquid/tablerowloop_drop.rb", + 3 + ], + [ + "lib/liquid/parse_tree_visitor.rb", + 3 + ] + ], + "source": null, + "signature": null, + "docstring": "Copyright (c) 2005 Tobias Luetke\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.", + "dynamic": null, + "tags": [ + + ] + }, + { + "type": "YARD::CodeObjects::ModuleObject", + "name": "Usage", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/usage.rb", + 4 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ] + }, + { + "type": "YARD::CodeObjects::ModuleObject", + "name": "Utils", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/utils.rb", + 4 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ] + }, + { + "type": "YARD::CodeObjects::ModuleObject", + "name": "Disabler", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag/disabler.rb", + 5 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ] + }, + { + "type": "YARD::CodeObjects::ModuleObject", + "name": "ClassMethods", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Disabler", + "files": [ + [ + "lib/liquid/tag/disabler.rb", + 6 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ] + }, + { + "type": "YARD::CodeObjects::ModuleObject", + "name": "BlockBodyProfilingHook", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/profiler/hooks.rb", + 4 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ] + }, + { + "type": "YARD::CodeObjects::ModuleObject", + "name": "DocumentProfilingHook", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/profiler/hooks.rb", + 17 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ] + }, + { + "type": "YARD::CodeObjects::ModuleObject", + "name": "ContextProfilingHook", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/profiler/hooks.rb", + 25 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ] + }, + { + "type": "YARD::CodeObjects::ModuleObject", + "name": "StandardFilters", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/standardfilters.rb", + 8 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ] + }, + { + "type": "YARD::CodeObjects::ModuleObject", + "name": "Disableable", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag/disableable.rb", + 5 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ] + }, + { + "type": "YARD::CodeObjects::ModuleObject", + "name": "ParserSwitching", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 4 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ] + }, + { + "type": "YARD::CodeObjects::ModuleObject", + "name": "StrainerFactory", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/strainer_factory.rb", + 5 + ] + ], + "source": null, + "signature": null, + "docstring": "StrainerFactory is the factory for the filters system.", + "dynamic": true, + "tags": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "Tag", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/tag.rb", + 4 + ], + [ + "lib/liquid/tag/disabler.rb", + 4 + ], + [ + "lib/liquid/tag/disableable.rb", + 4 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "nodelist", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def nodelist\n @nodelist\nend", + "signature": "def nodelist", + "docstring": "Returns the value of attribute nodelist.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "tag_name", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def tag_name\n @tag_name\nend", + "signature": "def tag_name", + "docstring": "Returns the value of attribute tag_name.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "line_number", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def line_number\n @line_number\nend", + "signature": "def line_number", + "docstring": "Returns the value of attribute line_number.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_context", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def parse_context\n @parse_context\nend", + "signature": "def parse_context", + "docstring": "Returns the value of attribute parse_context.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + "Liquid::Tag#options" + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "options", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 6 + ] + ], + "source": "def parse_context\n @parse_context\nend", + "signature": "def parse_context", + "docstring": "Returns the value of attribute parse_context.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 10 + ] + ], + "source": "def parse(tag_name, markup, tokenizer, parse_context)\n tag = new(tag_name, markup, parse_context)\n tag.parse(tokenizer)\n tag\nend", + "signature": "def parse(tag_name, markup, tokenizer, parse_context)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "tag_name", + null + ], + [ + "markup", + null + ], + [ + "tokenizer", + null + ], + [ + "parse_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "disable_tags", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 16 + ] + ], + "source": "def disable_tags(*tag_names)\n @disabled_tags ||= []\n @disabled_tags.concat(tag_names)\n prepend(Disabler)\nend", + "signature": "def disable_tags(*tag_names)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "*tag_names", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "initialize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 25 + ] + ], + "source": "def initialize(tag_name, markup, parse_context)\n @tag_name = tag_name\n @markup = markup\n @parse_context = parse_context\n @line_number = parse_context.line_number\nend", + "signature": "def initialize(tag_name, markup, parse_context)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "a new instance of Tag", + "types": [ + "Tag" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "tag_name", + null + ], + [ + "markup", + null + ], + [ + "parse_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 32 + ] + ], + "source": "def parse(_tokens)\nend", + "signature": "def parse(_tokens)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "_tokens", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "raw", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 35 + ] + ], + "source": "def raw\n \"#{@tag_name} #{@markup}\"\nend", + "signature": "def raw", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "name", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 39 + ] + ], + "source": "def name\n self.class.name.downcase\nend", + "signature": "def name", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "render", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 43 + ] + ], + "source": "def render(_context)\n ''\nend", + "signature": "def render(_context)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "render_to_output_buffer", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 50 + ] + ], + "source": "def render_to_output_buffer(context, output)\n output << render(context)\n output\nend", + "signature": "def render_to_output_buffer(context, output)", + "docstring": "For backwards compatibility with custom tags. In a future release, the semantics\nof the `render_to_output_buffer` method will become the default and the `render`\nmethod will be removed.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "context", + null + ], + [ + "output", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "blank?", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 55 + ] + ], + "source": "def blank?\n false\nend", + "signature": "def blank?", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "", + "types": [ + "Boolean" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_expression", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 61 + ] + ], + "source": "def parse_expression(markup)\n parse_context.parse_expression(markup)\nend", + "signature": "def parse_expression(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "strict_parse_with_error_mode_fallback", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 5 + ] + ], + "source": "def strict_parse_with_error_mode_fallback(markup)\n strict_parse_with_error_context(markup)\nrescue SyntaxError => e\n case parse_context.error_mode\n when :strict\n raise\n when :warn\n parse_context.warnings << e\n end\n lax_parse(markup)\nend", + "signature": "def strict_parse_with_error_mode_fallback(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_with_selected_parser", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 17 + ] + ], + "source": "def parse_with_selected_parser(markup)\n case parse_context.error_mode\n when :strict then strict_parse_with_error_context(markup)\n when :lax then lax_parse(markup)\n when :warn\n begin\n strict_parse_with_error_context(markup)\n rescue SyntaxError => e\n parse_context.warnings << e\n lax_parse(markup)\n end\n end\nend", + "signature": "def parse_with_selected_parser(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "strict_parse_with_error_context", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 33 + ] + ], + "source": "def strict_parse_with_error_context(markup)\n strict_parse(markup)\nrescue SyntaxError => e\n e.line_number = line_number\n e.markup_context = markup_context(markup)\n raise e\nend", + "signature": "def strict_parse_with_error_context(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "markup_context", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 41 + ] + ], + "source": "def markup_context(markup)\n \"in \\\"#{markup.strip}\\\"\"\nend", + "signature": "def markup_context(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + } + ], + "constants": [ + + ], + "instance_attributes": { + "nodelist": { + "read": "Liquid::Tag#nodelist", + "write": null + }, + "tag_name": { + "read": "Liquid::Tag#tag_name", + "write": null + }, + "line_number": { + "read": "Liquid::Tag#line_number", + "write": null + }, + "parse_context": { + "read": "Liquid::Tag#parse_context", + "write": null + } + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + { + "type": "YARD::CodeObjects::ModuleObject", + "name": "ParserSwitching", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 4 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ] + } + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "Drop", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/drop.rb", + 25 + ] + ], + "source": null, + "signature": null, + "docstring": "A drop in liquid is a class which allows you to export DOM like things to liquid.\nMethods of drops are callable.\nThe main use for liquid drops is to implement lazy loaded objects.\nIf you would like to make data available to the web designers which you don't want loaded unless needed then\na drop is a great way to do that.\n\nExample:\n\n class ProductDrop < Liquid::Drop\n def top_sales\n Shop.current.products.find(:all, :order => 'sales', :limit => 10 )\n end\n end\n\n tmpl = Liquid::Template.parse( ' {% for product in product.top_sales %} {{ product.name }} {%endfor%} ' )\n tmpl.render('product' => ProductDrop.new ) # will invoke top_sales query.\n\nYour drop can either implement the methods sans any parameters\nor implement the liquid_method_missing(name) method which is a catch all.", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "context=", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Drop", + "files": [ + [ + "lib/liquid/drop.rb", + 26 + ] + ], + "source": "def context=(value)\n @context = value\nend", + "signature": "def context=(value)", + "docstring": "Sets the attribute context", + "dynamic": true, + "tags": [ + { + "tag_name": "param", + "text": "the value to set the attribute context to.", + "types": null, + "name": "value" + } + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + [ + "value", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "liquid_method_missing", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Drop", + "files": [ + [ + "lib/liquid/drop.rb", + 29 + ] + ], + "source": "def liquid_method_missing(method)\n return nil unless @context&.strict_variables\n raise Liquid::UndefinedDropMethod, \"undefined method #{method}\"\nend", + "signature": "def liquid_method_missing(method)", + "docstring": "Catch all for the method", + "dynamic": true, + "tags": [ + { + "tag_name": "raise", + "text": "", + "types": [ + "Liquid::UndefinedDropMethod" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "method", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "invoke_drop", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Drop", + "files": [ + [ + "lib/liquid/drop.rb", + 35 + ] + ], + "source": "def invoke_drop(method_or_key)\n if self.class.invokable?(method_or_key)\n send(method_or_key)\n else\n liquid_method_missing(method_or_key)\n end\nend", + "signature": "def invoke_drop(method_or_key)", + "docstring": "called by liquid to invoke a drop", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "method_or_key", + null + ] + ], + "aliases": [ + "Liquid::Drop#[]" + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "key?", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Drop", + "files": [ + [ + "lib/liquid/drop.rb", + 43 + ] + ], + "source": "def key?(_name)\n true\nend", + "signature": "def key?(_name)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "", + "types": [ + "Boolean" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "_name", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "inspect", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Drop", + "files": [ + [ + "lib/liquid/drop.rb", + 47 + ] + ], + "source": "def inspect\n self.class.to_s\nend", + "signature": "def inspect", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "to_liquid", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Drop", + "files": [ + [ + "lib/liquid/drop.rb", + 51 + ] + ], + "source": "def to_liquid\n self\nend", + "signature": "def to_liquid", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "to_s", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Drop", + "files": [ + [ + "lib/liquid/drop.rb", + 55 + ] + ], + "source": "def to_s\n self.class.name\nend", + "signature": "def to_s", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "[]", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Drop", + "files": [ + [ + "lib/liquid/drop.rb", + 59 + ] + ], + "source": "def invoke_drop(method_or_key)\n if self.class.invokable?(method_or_key)\n send(method_or_key)\n else\n liquid_method_missing(method_or_key)\n end\nend", + "signature": "def invoke_drop(method_or_key)", + "docstring": "called by liquid to invoke a drop", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "invokable?", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Drop", + "files": [ + [ + "lib/liquid/drop.rb", + 62 + ] + ], + "source": "def self.invokable?(method_name)\n invokable_methods.include?(method_name.to_s)\nend", + "signature": "def invokable?(method_name)", + "docstring": "Check for method existence without invoking respond_to?, which creates symbols", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "", + "types": [ + "Boolean" + ], + "name": null + } + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "method_name", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "invokable_methods", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Drop", + "files": [ + [ + "lib/liquid/drop.rb", + 66 + ] + ], + "source": "def self.invokable_methods\n @invokable_methods ||= begin\n blacklist = Liquid::Drop.public_instance_methods + [:each]\n\n if include?(Enumerable)\n blacklist += Enumerable.public_instance_methods\n blacklist -= [:sort, :count, :first, :min, :max]\n end\n\n whitelist = [:to_liquid] + (public_instance_methods - blacklist)\n Set.new(whitelist.map(&:to_s))\n end\nend", + "signature": "def invokable_methods", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + } + ], + "constants": [ + + ], + "instance_attributes": { + "context": { + "read": null, + "write": "Liquid::Drop#context=" + } + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "I18n", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/i18n.rb", + 6 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "path", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "I18n", + "files": [ + [ + "lib/liquid/i18n.rb", + 11 + ] + ], + "source": "def path\n @path\nend", + "signature": "def path", + "docstring": "Returns the value of attribute path.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "initialize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "I18n", + "files": [ + [ + "lib/liquid/i18n.rb", + 13 + ] + ], + "source": "def initialize(path = DEFAULT_LOCALE)\n @path = path\nend", + "signature": "def initialize(path = DEFAULT_LOCALE)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "a new instance of I18n", + "types": [ + "I18n" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "path", + "DEFAULT_LOCALE" + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "translate", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "I18n", + "files": [ + [ + "lib/liquid/i18n.rb", + 17 + ] + ], + "source": "def translate(name, vars = {})\n interpolate(deep_fetch_translation(name), vars)\nend", + "signature": "def translate(name, vars = {})", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "name", + null + ], + [ + "vars", + "{}" + ] + ], + "aliases": [ + "Liquid::I18n#t" + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "t", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "I18n", + "files": [ + [ + "lib/liquid/i18n.rb", + 20 + ] + ], + "source": "def translate(name, vars = {})\n interpolate(deep_fetch_translation(name), vars)\nend", + "signature": "def translate(name, vars = {})", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "locale", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "I18n", + "files": [ + [ + "lib/liquid/i18n.rb", + 22 + ] + ], + "source": "def locale\n @locale ||= YAML.load_file(@path)\nend", + "signature": "def locale", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "interpolate", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "I18n", + "files": [ + [ + "lib/liquid/i18n.rb", + 28 + ] + ], + "source": "def interpolate(name, vars)\n name.gsub(/%\\{(\\w+)\\}/) do\n # raise TranslationError, \"Undefined key #{$1} for interpolation in translation #{name}\" unless vars[$1.to_sym]\n (vars[Regexp.last_match(1).to_sym]).to_s\n end\nend", + "signature": "def interpolate(name, vars)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "name", + null + ], + [ + "vars", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "deep_fetch_translation", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "I18n", + "files": [ + [ + "lib/liquid/i18n.rb", + 35 + ] + ], + "source": "def deep_fetch_translation(name)\n name.split('.').reduce(locale) do |level, cur|\n level[cur] || raise(TranslationError, \"Translation for #{name} does not exist in locale #{path}\")\n end\nend", + "signature": "def deep_fetch_translation(name)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "name", + null + ] + ], + "aliases": [ + + ] + } + ], + "constants": [ + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "DEFAULT_LOCALE", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "I18n", + "files": [ + [ + "lib/liquid/i18n.rb", + 7 + ] + ], + "source": "DEFAULT_LOCALE = File.join(File.expand_path(__dir__), \"locales\", \"en.yml\")", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "File.join(File.expand_path(__dir__), \"locales\", \"en.yml\")" + }, + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "TranslationError", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "I18n", + "files": [ + [ + "lib/liquid/i18n.rb", + 9 + ] + ], + "source": "TranslationError = Class.new(StandardError)", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "Class.new(StandardError)" + } + ], + "instance_attributes": { + "path": { + "read": "Liquid::I18n#path", + "write": null + } + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "Block", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/block.rb", + 4 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "initialize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 7 + ] + ], + "source": "def initialize(tag_name, markup, options)\n super\n @blank = true\nend", + "signature": "def initialize(tag_name, markup, options)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "a new instance of Block", + "types": [ + "Block" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "tag_name", + null + ], + [ + "markup", + null + ], + [ + "options", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 12 + ] + ], + "source": "def parse(tokens)\n @body = new_body\n while parse_body(@body, tokens)\n end\n @body.freeze\nend", + "signature": "def parse(tokens)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "tokens", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "render", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 20 + ] + ], + "source": "def render(context)\n @body.render(context)\nend", + "signature": "def render(context)", + "docstring": "For backwards compatibility", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "blank?", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 24 + ] + ], + "source": "def blank?\n @blank\nend", + "signature": "def blank?", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "", + "types": [ + "Boolean" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "nodelist", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 28 + ] + ], + "source": "def nodelist\n @body.nodelist\nend", + "signature": "def nodelist", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "unknown_tag", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 32 + ] + ], + "source": "def unknown_tag(tag_name, _markup, _tokenizer)\n Block.raise_unknown_tag(tag_name, block_name, block_delimiter, parse_context)\nend", + "signature": "def unknown_tag(tag_name, _markup, _tokenizer)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "tag_name", + null + ], + [ + "_markup", + null + ], + [ + "_tokenizer", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "raise_unknown_tag", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 37 + ] + ], + "source": "def self.raise_unknown_tag(tag, block_name, block_delimiter, parse_context)\n if tag == 'else'\n raise SyntaxError, parse_context.locale.t(\"errors.syntax.unexpected_else\",\n block_name: block_name)\n elsif tag.start_with?('end')\n raise SyntaxError, parse_context.locale.t(\"errors.syntax.invalid_delimiter\",\n tag: tag,\n block_name: block_name,\n block_delimiter: block_delimiter)\n else\n raise SyntaxError, parse_context.locale.t(\"errors.syntax.unknown_tag\", tag: tag)\n end\nend", + "signature": "def raise_unknown_tag(tag, block_name, block_delimiter, parse_context)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "api", + "text": "private", + "types": null, + "name": null + } + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "tag", + null + ], + [ + "block_name", + null + ], + [ + "block_delimiter", + null + ], + [ + "parse_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "raise_tag_never_closed", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 51 + ] + ], + "source": "def raise_tag_never_closed(block_name)\n raise SyntaxError, parse_context.locale.t(\"errors.syntax.tag_never_closed\", block_name: block_name)\nend", + "signature": "def raise_tag_never_closed(block_name)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "raise", + "text": "", + "types": [ + "SyntaxError" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "block_name", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "block_name", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 55 + ] + ], + "source": "def block_name\n @tag_name\nend", + "signature": "def block_name", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "block_delimiter", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 59 + ] + ], + "source": "def block_delimiter\n @block_delimiter ||= \"end#{block_name}\"\nend", + "signature": "def block_delimiter", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "new_body", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 66 + ] + ], + "source": "def new_body\n parse_context.new_block_body\nend", + "signature": "def new_body", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "api", + "text": "public", + "types": null, + "name": null + } + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_body", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 71 + ] + ], + "source": "def parse_body(body, tokens)\n if parse_context.depth >= MAX_DEPTH\n raise StackLevelError, \"Nesting too deep\"\n end\n parse_context.depth += 1\n begin\n body.parse(tokens, parse_context) do |end_tag_name, end_tag_params|\n @blank &&= body.blank?\n\n return false if end_tag_name == block_delimiter\n raise_tag_never_closed(block_name) unless end_tag_name\n\n # this tag is not registered with the system\n # pass it to the current block for special handling or error reporting\n unknown_tag(end_tag_name, end_tag_params, tokens)\n end\n ensure\n parse_context.depth -= 1\n end\n\n true\nend", + "signature": "def parse_body(body, tokens)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "api", + "text": "public", + "types": null, + "name": null + } + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "body", + null + ], + [ + "tokens", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "tag_name", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def tag_name\n @tag_name\nend", + "signature": "def tag_name", + "docstring": "Returns the value of attribute tag_name.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "line_number", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def line_number\n @line_number\nend", + "signature": "def line_number", + "docstring": "Returns the value of attribute line_number.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_context", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def parse_context\n @parse_context\nend", + "signature": "def parse_context", + "docstring": "Returns the value of attribute parse_context.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + "Liquid::Tag#options" + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "options", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 6 + ] + ], + "source": "def parse_context\n @parse_context\nend", + "signature": "def parse_context", + "docstring": "Returns the value of attribute parse_context.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 10 + ] + ], + "source": "def parse(tag_name, markup, tokenizer, parse_context)\n tag = new(tag_name, markup, parse_context)\n tag.parse(tokenizer)\n tag\nend", + "signature": "def parse(tag_name, markup, tokenizer, parse_context)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "tag_name", + null + ], + [ + "markup", + null + ], + [ + "tokenizer", + null + ], + [ + "parse_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "disable_tags", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 16 + ] + ], + "source": "def disable_tags(*tag_names)\n @disabled_tags ||= []\n @disabled_tags.concat(tag_names)\n prepend(Disabler)\nend", + "signature": "def disable_tags(*tag_names)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "*tag_names", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "raw", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 35 + ] + ], + "source": "def raw\n \"#{@tag_name} #{@markup}\"\nend", + "signature": "def raw", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "name", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 39 + ] + ], + "source": "def name\n self.class.name.downcase\nend", + "signature": "def name", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "render_to_output_buffer", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 50 + ] + ], + "source": "def render_to_output_buffer(context, output)\n output << render(context)\n output\nend", + "signature": "def render_to_output_buffer(context, output)", + "docstring": "For backwards compatibility with custom tags. In a future release, the semantics\nof the `render_to_output_buffer` method will become the default and the `render`\nmethod will be removed.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "context", + null + ], + [ + "output", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_expression", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 61 + ] + ], + "source": "def parse_expression(markup)\n parse_context.parse_expression(markup)\nend", + "signature": "def parse_expression(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "strict_parse_with_error_mode_fallback", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 5 + ] + ], + "source": "def strict_parse_with_error_mode_fallback(markup)\n strict_parse_with_error_context(markup)\nrescue SyntaxError => e\n case parse_context.error_mode\n when :strict\n raise\n when :warn\n parse_context.warnings << e\n end\n lax_parse(markup)\nend", + "signature": "def strict_parse_with_error_mode_fallback(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_with_selected_parser", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 17 + ] + ], + "source": "def parse_with_selected_parser(markup)\n case parse_context.error_mode\n when :strict then strict_parse_with_error_context(markup)\n when :lax then lax_parse(markup)\n when :warn\n begin\n strict_parse_with_error_context(markup)\n rescue SyntaxError => e\n parse_context.warnings << e\n lax_parse(markup)\n end\n end\nend", + "signature": "def parse_with_selected_parser(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "strict_parse_with_error_context", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 33 + ] + ], + "source": "def strict_parse_with_error_context(markup)\n strict_parse(markup)\nrescue SyntaxError => e\n e.line_number = line_number\n e.markup_context = markup_context(markup)\n raise e\nend", + "signature": "def strict_parse_with_error_context(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "markup_context", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 41 + ] + ], + "source": "def markup_context(markup)\n \"in \\\"#{markup.strip}\\\"\"\nend", + "signature": "def markup_context(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + } + ], + "constants": [ + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "MAX_DEPTH", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 5 + ] + ], + "source": "MAX_DEPTH = 100", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "100" + } + ], + "instance_attributes": { + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "Lexer", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/lexer.rb", + 5 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "initialize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Lexer", + "files": [ + [ + "lib/liquid/lexer.rb", + 26 + ] + ], + "source": "def initialize(input)\n @ss = StringScanner.new(input)\nend", + "signature": "def initialize(input)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "a new instance of Lexer", + "types": [ + "Lexer" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "input", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "tokenize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Lexer", + "files": [ + [ + "lib/liquid/lexer.rb", + 30 + ] + ], + "source": "def tokenize\n @output = []\n\n until @ss.eos?\n @ss.skip(WHITESPACE_OR_NOTHING)\n break if @ss.eos?\n tok = if (t = @ss.scan(COMPARISON_OPERATOR))\n [:comparison, t]\n elsif (t = @ss.scan(SINGLE_STRING_LITERAL))\n [:string, t]\n elsif (t = @ss.scan(DOUBLE_STRING_LITERAL))\n [:string, t]\n elsif (t = @ss.scan(NUMBER_LITERAL))\n [:number, t]\n elsif (t = @ss.scan(IDENTIFIER))\n [:id, t]\n elsif (t = @ss.scan(DOTDOT))\n [:dotdot, t]\n else\n c = @ss.getch\n if (s = SPECIALS[c])\n [s, c]\n else\n raise SyntaxError, \"Unexpected character #{c}\"\n end\n end\n @output << tok\n end\n\n @output << [:end_of_string]\nend", + "signature": "def tokenize", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + } + ], + "constants": [ + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "SPECIALS", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Lexer", + "files": [ + [ + "lib/liquid/lexer.rb", + 6 + ] + ], + "source": "SPECIALS = {\n '|' => :pipe,\n '.' => :dot,\n ':' => :colon,\n ',' => :comma,\n '[' => :open_square,\n ']' => :close_square,\n '(' => :open_round,\n ')' => :close_round,\n '?' => :question,\n '-' => :dash,\n}.freeze", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "{\n '|' => :pipe,\n '.' => :dot,\n ':' => :colon,\n ',' => :comma,\n '[' => :open_square,\n ']' => :close_square,\n '(' => :open_round,\n ')' => :close_round,\n '?' => :question,\n '-' => :dash,\n}.freeze" + }, + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "IDENTIFIER", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Lexer", + "files": [ + [ + "lib/liquid/lexer.rb", + 18 + ] + ], + "source": "IDENTIFIER = /[a-zA-Z_][\\w-]*\\??/", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "/[a-zA-Z_][\\w-]*\\??/" + }, + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "SINGLE_STRING_LITERAL", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Lexer", + "files": [ + [ + "lib/liquid/lexer.rb", + 19 + ] + ], + "source": "SINGLE_STRING_LITERAL = /'[^\\']*'/", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "/'[^\\']*'/" + }, + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "DOUBLE_STRING_LITERAL", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Lexer", + "files": [ + [ + "lib/liquid/lexer.rb", + 20 + ] + ], + "source": "DOUBLE_STRING_LITERAL = /\"[^\\\"]*\"/", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "/\"[^\\\"]*\"/" + }, + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "NUMBER_LITERAL", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Lexer", + "files": [ + [ + "lib/liquid/lexer.rb", + 21 + ] + ], + "source": "NUMBER_LITERAL = /-?\\d+(\\.\\d+)?/", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "/-?\\d+(\\.\\d+)?/" + }, + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "DOTDOT", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Lexer", + "files": [ + [ + "lib/liquid/lexer.rb", + 22 + ] + ], + "source": "DOTDOT = /\\.\\./", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "/\\.\\./" + }, + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "COMPARISON_OPERATOR", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Lexer", + "files": [ + [ + "lib/liquid/lexer.rb", + 23 + ] + ], + "source": "COMPARISON_OPERATOR = /==|!=|<>|<=?|>=?|contains(?=\\s)/", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "/==|!=|<>|<=?|>=?|contains(?=\\s)/" + }, + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "WHITESPACE_OR_NOTHING", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Lexer", + "files": [ + [ + "lib/liquid/lexer.rb", + 24 + ] + ], + "source": "WHITESPACE_OR_NOTHING = /\\s*/", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "/\\s*/" + } + ], + "instance_attributes": { + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "Error", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/errors.rb", + 4 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "line_number", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Error", + "files": [ + [ + "lib/liquid/errors.rb", + 5 + ] + ], + "source": "def line_number\n @line_number\nend", + "signature": "def line_number", + "docstring": "Returns the value of attribute line_number.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "line_number=", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Error", + "files": [ + [ + "lib/liquid/errors.rb", + 5 + ] + ], + "source": "def line_number=(value)\n @line_number = value\nend", + "signature": "def line_number=(value)", + "docstring": "Sets the attribute line_number", + "dynamic": true, + "tags": [ + { + "tag_name": "param", + "text": "the value to set the attribute line_number to.", + "types": null, + "name": "value" + } + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + [ + "value", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "template_name", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Error", + "files": [ + [ + "lib/liquid/errors.rb", + 6 + ] + ], + "source": "def template_name\n @template_name\nend", + "signature": "def template_name", + "docstring": "Returns the value of attribute template_name.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "template_name=", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Error", + "files": [ + [ + "lib/liquid/errors.rb", + 6 + ] + ], + "source": "def template_name=(value)\n @template_name = value\nend", + "signature": "def template_name=(value)", + "docstring": "Sets the attribute template_name", + "dynamic": true, + "tags": [ + { + "tag_name": "param", + "text": "the value to set the attribute template_name to.", + "types": null, + "name": "value" + } + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + [ + "value", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "markup_context", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Error", + "files": [ + [ + "lib/liquid/errors.rb", + 7 + ] + ], + "source": "def markup_context\n @markup_context\nend", + "signature": "def markup_context", + "docstring": "Returns the value of attribute markup_context.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "markup_context=", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Error", + "files": [ + [ + "lib/liquid/errors.rb", + 7 + ] + ], + "source": "def markup_context=(value)\n @markup_context = value\nend", + "signature": "def markup_context=(value)", + "docstring": "Sets the attribute markup_context", + "dynamic": true, + "tags": [ + { + "tag_name": "param", + "text": "the value to set the attribute markup_context to.", + "types": null, + "name": "value" + } + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + [ + "value", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "to_s", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Error", + "files": [ + [ + "lib/liquid/errors.rb", + 9 + ] + ], + "source": "def to_s(with_prefix = true)\n str = +\"\"\n str << message_prefix if with_prefix\n str << super()\n\n if markup_context\n str << \" \"\n str << markup_context\n end\n\n str\nend", + "signature": "def to_s(with_prefix = true)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "with_prefix", + "true" + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "message_prefix", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Error", + "files": [ + [ + "lib/liquid/errors.rb", + 24 + ] + ], + "source": "def message_prefix\n str = +\"\"\n str << if is_a?(SyntaxError)\n \"Liquid syntax error\"\n else\n \"Liquid error\"\n end\n\n if line_number\n str << \" (\"\n str << template_name << \" \" if template_name\n str << \"line \" << line_number.to_s << \")\"\n end\n\n str << \": \"\n str\nend", + "signature": "def message_prefix", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + } + ], + "constants": [ + + ], + "instance_attributes": { + "line_number": { + "read": "Liquid::Error#line_number", + "write": "Liquid::Error#line_number=" + }, + "template_name": { + "read": "Liquid::Error#template_name", + "write": "Liquid::Error#template_name=" + }, + "markup_context": { + "read": "Liquid::Error#markup_context", + "write": "Liquid::Error#markup_context=" + } + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "Parser", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/parser.rb", + 4 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "initialize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Parser", + "files": [ + [ + "lib/liquid/parser.rb", + 5 + ] + ], + "source": "def initialize(input)\n l = Lexer.new(input)\n @tokens = l.tokenize\n @p = 0 # pointer to current location\nend", + "signature": "def initialize(input)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "a new instance of Parser", + "types": [ + "Parser" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "input", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "jump", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Parser", + "files": [ + [ + "lib/liquid/parser.rb", + 11 + ] + ], + "source": "def jump(point)\n @p = point\nend", + "signature": "def jump(point)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "point", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "consume", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Parser", + "files": [ + [ + "lib/liquid/parser.rb", + 15 + ] + ], + "source": "def consume(type = nil)\n token = @tokens[@p]\n if type && token[0] != type\n raise SyntaxError, \"Expected #{type} but found #{@tokens[@p].first}\"\n end\n @p += 1\n token[1]\nend", + "signature": "def consume(type = nil)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "type", + "nil" + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "consume?", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Parser", + "files": [ + [ + "lib/liquid/parser.rb", + 27 + ] + ], + "source": "def consume?(type)\n token = @tokens[@p]\n return false unless token && token[0] == type\n @p += 1\n token[1]\nend", + "signature": "def consume?(type)", + "docstring": "Only consumes the token if it matches the type\nReturns the token's contents if it was consumed\nor false otherwise.", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "", + "types": [ + "Boolean" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "type", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "id?", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Parser", + "files": [ + [ + "lib/liquid/parser.rb", + 35 + ] + ], + "source": "def id?(str)\n token = @tokens[@p]\n return false unless token && token[0] == :id\n return false unless token[1] == str\n @p += 1\n token[1]\nend", + "signature": "def id?(str)", + "docstring": "Like consume? Except for an :id token of a certain name", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "", + "types": [ + "Boolean" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "str", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "look", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Parser", + "files": [ + [ + "lib/liquid/parser.rb", + 43 + ] + ], + "source": "def look(type, ahead = 0)\n tok = @tokens[@p + ahead]\n return false unless tok\n tok[0] == type\nend", + "signature": "def look(type, ahead = 0)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "type", + null + ], + [ + "ahead", + "0" + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "expression", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Parser", + "files": [ + [ + "lib/liquid/parser.rb", + 49 + ] + ], + "source": "def expression\n token = @tokens[@p]\n case token[0]\n when :id\n str = consume\n str << variable_lookups\n when :open_square\n str = consume\n str << expression\n str << consume(:close_square)\n str << variable_lookups\n when :string, :number\n consume\n when :open_round\n consume\n first = expression\n consume(:dotdot)\n last = expression\n consume(:close_round)\n \"(#{first}..#{last})\"\n else\n raise SyntaxError, \"#{token} is not a valid expression\"\n end\nend", + "signature": "def expression", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "argument", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Parser", + "files": [ + [ + "lib/liquid/parser.rb", + 74 + ] + ], + "source": "def argument\n str = +\"\"\n # might be a keyword argument (identifier: expression)\n if look(:id) && look(:colon, 1)\n str << consume << consume << ' '\n end\n\n str << expression\n str\nend", + "signature": "def argument", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "variable_lookups", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Parser", + "files": [ + [ + "lib/liquid/parser.rb", + 85 + ] + ], + "source": "def variable_lookups\n str = +\"\"\n loop do\n if look(:open_square)\n str << consume\n str << expression\n str << consume(:close_square)\n elsif look(:dot)\n str << consume\n str << consume(:id)\n else\n break\n end\n end\n str\nend", + "signature": "def variable_lookups", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + } + ], + "constants": [ + + ], + "instance_attributes": { + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "Context", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/context.rb", + 16 + ] + ], + "source": null, + "signature": null, + "docstring": "Context keeps the variable stack and resolves variables, as well as keywords\n\n context['variable'] = 'testing'\n context['variable'] #=> 'testing'\n context['true'] #=> true\n context['10.2232'] #=> 10.2232\n\n context.stack do\n context['bob'] = 'bobsen'\n end\n\n context['bob'] #=> nil class Context", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "scopes", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Context", + "files": [ + [ + "lib/liquid/context.rb", + 17 + ] + ], + "source": "def scopes\n @scopes\nend", + "signature": "def scopes", + "docstring": "Returns the value of attribute scopes.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "errors", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Context", + "files": [ + [ + "lib/liquid/context.rb", + 17 + ] + ], + "source": "def errors\n @errors\nend", + "signature": "def errors", + "docstring": "Returns the value of attribute errors.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "registers", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Context", + "files": [ + [ + "lib/liquid/context.rb", + 17 + ] + ], + "source": "def registers\n @registers\nend", + "signature": "def registers", + "docstring": "Returns the value of attribute registers.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "environments", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Context", + "files": [ + [ + "lib/liquid/context.rb", + 17 + ] + ], + "source": "def environments\n @environments\nend", + "signature": "def environments", + "docstring": "Returns the value of attribute environments.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "resource_limits", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Context", + "files": [ + [ + "lib/liquid/context.rb", + 17 + ] + ], + "source": "def resource_limits\n @resource_limits\nend", + "signature": "def resource_limits", + "docstring": "Returns the value of attribute resource_limits.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "static_registers", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Context", + "files": [ + [ + "lib/liquid/context.rb", + 17 + ] + ], + "source": "def static_registers\n @static_registers\nend", + "signature": "def static_registers", + "docstring": "Returns the value of attribute static_registers.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "static_environments", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Context", + "files": [ + [ + "lib/liquid/context.rb", + 17 + ] + ], + "source": "def static_environments\n @static_environments\nend", + "signature": "def static_environments", + "docstring": "Returns the value of attribute static_environments.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "exception_renderer", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Context", + "files": [ + [ + "lib/liquid/context.rb", + 18 + ] + ], + "source": "def exception_renderer\n @exception_renderer\nend", + "signature": "def exception_renderer", + "docstring": "Returns the value of attribute exception_renderer.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "exception_renderer=", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Context", + "files": [ + [ + "lib/liquid/context.rb", + 18 + ] + ], + "source": "def exception_renderer=(value)\n @exception_renderer = value\nend", + "signature": "def exception_renderer=(value)", + "docstring": "Sets the attribute exception_renderer", + "dynamic": true, + "tags": [ + { + "tag_name": "param", + "text": "the value to set the attribute exception_renderer to.", + "types": null, + "name": "value" + } + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + [ + "value", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "template_name", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Context", + "files": [ + [ + "lib/liquid/context.rb", + 18 + ] + ], + "source": "def template_name\n @template_name\nend", + "signature": "def template_name", + "docstring": "Returns the value of attribute template_name.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "template_name=", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Context", + "files": [ + [ + "lib/liquid/context.rb", + 18 + ] + ], + "source": "def template_name=(value)\n @template_name = value\nend", + "signature": "def template_name=(value)", + "docstring": "Sets the attribute template_name", + "dynamic": true, + "tags": [ + { + "tag_name": "param", + "text": "the value to set the attribute template_name to.", + "types": null, + "name": "value" + } + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + [ + "value", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "partial", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Context", + "files": [ + [ + "lib/liquid/context.rb", + 18 + ] + ], + "source": "def partial\n @partial\nend", + "signature": "def partial", + "docstring": "Returns the value of attribute partial.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "partial=", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Context", + "files": [ + [ + "lib/liquid/context.rb", + 18 + ] + ], + "source": "def partial=(value)\n @partial = value\nend", + "signature": "def partial=(value)", + "docstring": "Sets the attribute partial", + "dynamic": true, + "tags": [ + { + "tag_name": "param", + "text": "the value to set the attribute partial to.", + "types": null, + "name": "value" + } + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + [ + "value", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "global_filter", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Context", + "files": [ + [ + "lib/liquid/context.rb", + 18 + ] + ], + "source": "def global_filter\n @global_filter\nend", + "signature": "def global_filter", + "docstring": "Returns the value of attribute global_filter.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "global_filter=", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Context", + "files": [ + [ + "lib/liquid/context.rb", + 18 + ] + ], + "source": "def global_filter=(value)\n @global_filter = value\nend", + "signature": "def global_filter=(value)", + "docstring": "Sets the attribute global_filter", + "dynamic": true, + "tags": [ + { + "tag_name": "param", + "text": "the value to set the attribute global_filter to.", + "types": null, + "name": "value" + } + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + [ + "value", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "strict_variables", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Context", + "files": [ + [ + "lib/liquid/context.rb", + 18 + ] + ], + "source": "def strict_variables\n @strict_variables\nend", + "signature": "def strict_variables", + "docstring": "Returns the value of attribute strict_variables.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "strict_variables=", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Context", + "files": [ + [ + "lib/liquid/context.rb", + 18 + ] + ], + "source": "def strict_variables=(value)\n @strict_variables = value\nend", + "signature": "def strict_variables=(value)", + "docstring": "Sets the attribute strict_variables", + "dynamic": true, + "tags": [ + { + "tag_name": "param", + "text": "the value to set the attribute strict_variables to.", + "types": null, + "name": "value" + } + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + [ + "value", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "strict_filters", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Context", + "files": [ + [ + "lib/liquid/context.rb", + 18 + ] + ], + "source": "def strict_filters\n @strict_filters\nend", + "signature": "def strict_filters", + "docstring": "Returns the value of attribute strict_filters.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "strict_filters=", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Context", + "files": [ + [ + "lib/liquid/context.rb", + 18 + ] + ], + "source": "def strict_filters=(value)\n @strict_filters = value\nend", + "signature": "def strict_filters=(value)", + "docstring": "Sets the attribute strict_filters", + "dynamic": true, + "tags": [ + { + "tag_name": "param", + "text": "the value to set the attribute strict_filters to.", + "types": null, + "name": "value" + } + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + [ + "value", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "build", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Context", + "files": [ + [ + "lib/liquid/context.rb", + 21 + ] + ], + "source": "def self.build(environments: {}, outer_scope: {}, registers: {}, rethrow_errors: false, resource_limits: nil, static_environments: {}, &block)\n new(environments, outer_scope, registers, rethrow_errors, resource_limits, static_environments, &block)\nend", + "signature": "def build(environments: {}, outer_scope: {}, registers: {}, rethrow_errors: false, resource_limits: nil, static_environments: {}, &block)", + "docstring": "rubocop:disable Metrics/ParameterLists", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "environments:", + "{}" + ], + [ + "outer_scope:", + "{}" + ], + [ + "registers:", + "{}" + ], + [ + "rethrow_errors:", + "false" + ], + [ + "resource_limits:", + "nil" + ], + [ + "static_environments:", + "{}" + ], + [ + "&block", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "initialize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Context", + "files": [ + [ + "lib/liquid/context.rb", + 25 + ] + ], + "source": "def initialize(environments = {}, outer_scope = {}, registers = {}, rethrow_errors = false, resource_limits = nil, static_environments = {})\n @environments = [environments]\n @environments.flatten!\n\n @static_environments = [static_environments].flat_map(&:freeze).freeze\n @scopes = [(outer_scope || {})]\n @registers = registers\n @errors = []\n @partial = false\n @strict_variables = false\n @resource_limits = resource_limits || ResourceLimits.new(Template.default_resource_limits)\n @base_scope_depth = 0\n @interrupts = []\n @filters = []\n @global_filter = nil\n @disabled_tags = {}\n\n self.exception_renderer = Template.default_exception_renderer\n if rethrow_errors\n self.exception_renderer = Liquid::RAISE_EXCEPTION_LAMBDA\n end\n\n yield self if block_given?\n\n # Do this last, since it could result in this object being passed to a Proc in the environment\n squash_instance_assigns_with_environments\nend", + "signature": "def initialize(environments = {}, outer_scope = {}, registers = {}, rethrow_errors = false, resource_limits = nil, static_environments = {})", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "a new instance of Context", + "types": [ + "Context" + ], + "name": null + }, + { + "tag_name": "yield", + "text": "", + "types": [ + "_self" + ], + "name": null + }, + { + "tag_name": "yieldparam", + "text": "the object that the method was called on", + "types": [ + "Liquid::Context" + ], + "name": "_self" + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "environments", + "{}" + ], + [ + "outer_scope", + "{}" + ], + [ + "registers", + "{}" + ], + [ + "rethrow_errors", + "false" + ], + [ + "resource_limits", + "nil" + ], + [ + "static_environments", + "{}" + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "warnings", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Context", + "files": [ + [ + "lib/liquid/context.rb", + 54 + ] + ], + "source": "def warnings\n @warnings ||= []\nend", + "signature": "def warnings", + "docstring": "rubocop:enable Metrics/ParameterLists", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "strainer", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Context", + "files": [ + [ + "lib/liquid/context.rb", + 58 + ] + ], + "source": "def strainer\n @strainer ||= StrainerFactory.create(self, @filters)\nend", + "signature": "def strainer", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "add_filters", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Context", + "files": [ + [ + "lib/liquid/context.rb", + 66 + ] + ], + "source": "def add_filters(filters)\n filters = [filters].flatten.compact\n @filters += filters\n @strainer = nil\nend", + "signature": "def add_filters(filters)", + "docstring": "Adds filters to this context.\n\nNote that this does not register the filters with the main Template object. see Template.register_filter\nfor that", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "filters", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "apply_global_filter", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Context", + "files": [ + [ + "lib/liquid/context.rb", + 72 + ] + ], + "source": "def apply_global_filter(obj)\n global_filter.nil? ? obj : global_filter.call(obj)\nend", + "signature": "def apply_global_filter(obj)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "obj", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "interrupt?", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Context", + "files": [ + [ + "lib/liquid/context.rb", + 77 + ] + ], + "source": "def interrupt?\n !@interrupts.empty?\nend", + "signature": "def interrupt?", + "docstring": "are there any not handled interrupts?", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "", + "types": [ + "Boolean" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "push_interrupt", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Context", + "files": [ + [ + "lib/liquid/context.rb", + 82 + ] + ], + "source": "def push_interrupt(e)\n @interrupts.push(e)\nend", + "signature": "def push_interrupt(e)", + "docstring": "push an interrupt to the stack. this interrupt is considered not handled.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "e", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "pop_interrupt", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Context", + "files": [ + [ + "lib/liquid/context.rb", + 87 + ] + ], + "source": "def pop_interrupt\n @interrupts.pop\nend", + "signature": "def pop_interrupt", + "docstring": "pop an interrupt from the stack", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "handle_error", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Context", + "files": [ + [ + "lib/liquid/context.rb", + 91 + ] + ], + "source": "def handle_error(e, line_number = nil)\n e = internal_error unless e.is_a?(Liquid::Error)\n e.template_name ||= template_name\n e.line_number ||= line_number\n errors.push(e)\n exception_renderer.call(e).to_s\nend", + "signature": "def handle_error(e, line_number = nil)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "e", + null + ], + [ + "line_number", + "nil" + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "invoke", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Context", + "files": [ + [ + "lib/liquid/context.rb", + 99 + ] + ], + "source": "def invoke(method, *args)\n strainer.invoke(method, *args).to_liquid\nend", + "signature": "def invoke(method, *args)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "method", + null + ], + [ + "*args", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "push", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Context", + "files": [ + [ + "lib/liquid/context.rb", + 104 + ] + ], + "source": "def push(new_scope = {})\n @scopes.unshift(new_scope)\n check_overflow\nend", + "signature": "def push(new_scope = {})", + "docstring": "Push new local scope on the stack. use Context#stack instead", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "new_scope", + "{}" + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "merge", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Context", + "files": [ + [ + "lib/liquid/context.rb", + 110 + ] + ], + "source": "def merge(new_scopes)\n @scopes[0].merge!(new_scopes)\nend", + "signature": "def merge(new_scopes)", + "docstring": "Merge a hash of variables in the current local scope", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "new_scopes", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "pop", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Context", + "files": [ + [ + "lib/liquid/context.rb", + 115 + ] + ], + "source": "def pop\n raise ContextError if @scopes.size == 1\n @scopes.shift\nend", + "signature": "def pop", + "docstring": "Pop from the stack. use Context#stack instead", + "dynamic": true, + "tags": [ + { + "tag_name": "raise", + "text": "", + "types": [ + "ContextError" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "stack", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Context", + "files": [ + [ + "lib/liquid/context.rb", + 128 + ] + ], + "source": "def stack(new_scope = {})\n push(new_scope)\n yield\nensure\n pop\nend", + "signature": "def stack(new_scope = {})", + "docstring": "Pushes a new local scope on the stack, pops it at the end of the block\n\nExample:\n context.stack do\n context['var'] = 'hi'\n end\n\n context['var'] #=> nil", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "new_scope", + "{}" + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "new_isolated_subcontext", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Context", + "files": [ + [ + "lib/liquid/context.rb", + 137 + ] + ], + "source": "def new_isolated_subcontext\n check_overflow\n\n self.class.build(\n resource_limits: resource_limits,\n static_environments: static_environments,\n registers: StaticRegisters.new(registers)\n ).tap do |subcontext|\n subcontext.base_scope_depth = base_scope_depth + 1\n subcontext.exception_renderer = exception_renderer\n subcontext.filters = @filters\n subcontext.strainer = nil\n subcontext.errors = errors\n subcontext.warnings = warnings\n subcontext.disabled_tags = @disabled_tags\n end\nend", + "signature": "def new_isolated_subcontext", + "docstring": "Creates a new context inheriting resource limits, filters, environment etc.,\nbut with an isolated scope.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "clear_instance_assigns", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Context", + "files": [ + [ + "lib/liquid/context.rb", + 155 + ] + ], + "source": "def clear_instance_assigns\n @scopes[0] = {}\nend", + "signature": "def clear_instance_assigns", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "[]=", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Context", + "files": [ + [ + "lib/liquid/context.rb", + 160 + ] + ], + "source": "def []=(key, value)\n @scopes[0][key] = value\nend", + "signature": "def []=(key, value)", + "docstring": "Only allow String, Numeric, Hash, Array, Proc, Boolean or Liquid::Drop", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "key", + null + ], + [ + "value", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "[]", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Context", + "files": [ + [ + "lib/liquid/context.rb", + 172 + ] + ], + "source": "def [](expression)\n evaluate(Expression.parse(expression))\nend", + "signature": "def [](expression)", + "docstring": "Look up variable, either resolve directly after considering the name. We can directly handle\nStrings, digits, floats and booleans (true,false).\nIf no match is made we lookup the variable in the current scope and\nlater move up to the parent blocks to see if we can resolve the variable somewhere up the tree.\nSome special keywords return symbols. Those symbols are to be called on the rhs object in expressions\n\nExample:\n products == empty #=> products.empty?", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "expression", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "key?", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Context", + "files": [ + [ + "lib/liquid/context.rb", + 176 + ] + ], + "source": "def key?(key)\n self[key] != nil\nend", + "signature": "def key?(key)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "", + "types": [ + "Boolean" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "key", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "evaluate", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Context", + "files": [ + [ + "lib/liquid/context.rb", + 180 + ] + ], + "source": "def evaluate(object)\n object.respond_to?(:evaluate) ? object.evaluate(self) : object\nend", + "signature": "def evaluate(object)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "object", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "find_variable", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Context", + "files": [ + [ + "lib/liquid/context.rb", + 185 + ] + ], + "source": "def find_variable(key, raise_on_not_found: true)\n # This was changed from find() to find_index() because this is a very hot\n # path and find_index() is optimized in MRI to reduce object allocation\n index = @scopes.find_index { |s| s.key?(key) }\n\n variable = if index\n lookup_and_evaluate(@scopes[index], key, raise_on_not_found: raise_on_not_found)\n else\n try_variable_find_in_environments(key, raise_on_not_found: raise_on_not_found)\n end\n\n variable = variable.to_liquid\n variable.context = self if variable.respond_to?(:context=)\n\n variable\nend", + "signature": "def find_variable(key, raise_on_not_found: true)", + "docstring": "Fetches an object starting at the local scope and then moving up the hierachy", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "key", + null + ], + [ + "raise_on_not_found:", + "true" + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "lookup_and_evaluate", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Context", + "files": [ + [ + "lib/liquid/context.rb", + 202 + ] + ], + "source": "def lookup_and_evaluate(obj, key, raise_on_not_found: true)\n if @strict_variables && raise_on_not_found && obj.respond_to?(:key?) && !obj.key?(key)\n raise Liquid::UndefinedVariable, \"undefined variable #{key}\"\n end\n\n value = obj[key]\n\n if value.is_a?(Proc) && obj.respond_to?(:[]=)\n obj[key] = value.arity == 0 ? value.call : value.call(self)\n else\n value\n end\nend", + "signature": "def lookup_and_evaluate(obj, key, raise_on_not_found: true)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "obj", + null + ], + [ + "key", + null + ], + [ + "raise_on_not_found:", + "true" + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "with_disabled_tags", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Context", + "files": [ + [ + "lib/liquid/context.rb", + 216 + ] + ], + "source": "def with_disabled_tags(tag_names)\n tag_names.each do |name|\n @disabled_tags[name] = @disabled_tags.fetch(name, 0) + 1\n end\n yield\nensure\n tag_names.each do |name|\n @disabled_tags[name] -= 1\n end\nend", + "signature": "def with_disabled_tags(tag_names)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "tag_names", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "tag_disabled?", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Context", + "files": [ + [ + "lib/liquid/context.rb", + 227 + ] + ], + "source": "def tag_disabled?(tag_name)\n @disabled_tags.fetch(tag_name, 0) > 0\nend", + "signature": "def tag_disabled?(tag_name)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "", + "types": [ + "Boolean" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "tag_name", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "base_scope_depth=", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Context", + "files": [ + [ + "lib/liquid/context.rb", + 233 + ] + ], + "source": "def base_scope_depth=(value)\n @base_scope_depth = value\nend", + "signature": "def base_scope_depth=(value)", + "docstring": "Sets the attribute base_scope_depth", + "dynamic": true, + "tags": [ + { + "tag_name": "param", + "text": "the value to set the attribute base_scope_depth to.", + "types": null, + "name": "value" + } + ], + "visibility": "protected", + "scope": "instance", + "explicit": null, + "parameters": [ + [ + "value", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "warnings=", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Context", + "files": [ + [ + "lib/liquid/context.rb", + 233 + ] + ], + "source": "def warnings=(value)\n @warnings = value\nend", + "signature": "def warnings=(value)", + "docstring": "Sets the attribute warnings", + "dynamic": true, + "tags": [ + { + "tag_name": "param", + "text": "the value to set the attribute warnings to.", + "types": null, + "name": "value" + } + ], + "visibility": "protected", + "scope": "instance", + "explicit": null, + "parameters": [ + [ + "value", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "errors=", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Context", + "files": [ + [ + "lib/liquid/context.rb", + 233 + ] + ], + "source": "def errors=(value)\n @errors = value\nend", + "signature": "def errors=(value)", + "docstring": "Sets the attribute errors", + "dynamic": true, + "tags": [ + { + "tag_name": "param", + "text": "the value to set the attribute errors to.", + "types": null, + "name": "value" + } + ], + "visibility": "protected", + "scope": "instance", + "explicit": null, + "parameters": [ + [ + "value", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "strainer=", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Context", + "files": [ + [ + "lib/liquid/context.rb", + 233 + ] + ], + "source": "def strainer=(value)\n @strainer = value\nend", + "signature": "def strainer=(value)", + "docstring": "Sets the attribute strainer", + "dynamic": true, + "tags": [ + { + "tag_name": "param", + "text": "the value to set the attribute strainer to.", + "types": null, + "name": "value" + } + ], + "visibility": "protected", + "scope": "instance", + "explicit": null, + "parameters": [ + [ + "value", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "filters=", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Context", + "files": [ + [ + "lib/liquid/context.rb", + 233 + ] + ], + "source": "def filters=(value)\n @filters = value\nend", + "signature": "def filters=(value)", + "docstring": "Sets the attribute filters", + "dynamic": true, + "tags": [ + { + "tag_name": "param", + "text": "the value to set the attribute filters to.", + "types": null, + "name": "value" + } + ], + "visibility": "protected", + "scope": "instance", + "explicit": null, + "parameters": [ + [ + "value", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "disabled_tags=", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Context", + "files": [ + [ + "lib/liquid/context.rb", + 233 + ] + ], + "source": "def disabled_tags=(value)\n @disabled_tags = value\nend", + "signature": "def disabled_tags=(value)", + "docstring": "Sets the attribute disabled_tags", + "dynamic": true, + "tags": [ + { + "tag_name": "param", + "text": "the value to set the attribute disabled_tags to.", + "types": null, + "name": "value" + } + ], + "visibility": "protected", + "scope": "instance", + "explicit": null, + "parameters": [ + [ + "value", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "base_scope_depth", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Context", + "files": [ + [ + "lib/liquid/context.rb", + 237 + ] + ], + "source": "def base_scope_depth\n @base_scope_depth\nend", + "signature": "def base_scope_depth", + "docstring": "Returns the value of attribute base_scope_depth.", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "try_variable_find_in_environments", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Context", + "files": [ + [ + "lib/liquid/context.rb", + 239 + ] + ], + "source": "def try_variable_find_in_environments(key, raise_on_not_found:)\n @environments.each do |environment|\n found_variable = lookup_and_evaluate(environment, key, raise_on_not_found: raise_on_not_found)\n if !found_variable.nil? || @strict_variables && raise_on_not_found\n return found_variable\n end\n end\n @static_environments.each do |environment|\n found_variable = lookup_and_evaluate(environment, key, raise_on_not_found: raise_on_not_found)\n if !found_variable.nil? || @strict_variables && raise_on_not_found\n return found_variable\n end\n end\n nil\nend", + "signature": "def try_variable_find_in_environments(key, raise_on_not_found:)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "key", + null + ], + [ + "raise_on_not_found:", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "check_overflow", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Context", + "files": [ + [ + "lib/liquid/context.rb", + 255 + ] + ], + "source": "def check_overflow\n raise StackLevelError, \"Nesting too deep\" if overflow?\nend", + "signature": "def check_overflow", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "raise", + "text": "", + "types": [ + "StackLevelError" + ], + "name": null + } + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "overflow?", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Context", + "files": [ + [ + "lib/liquid/context.rb", + 259 + ] + ], + "source": "def overflow?\n base_scope_depth + @scopes.length > Block::MAX_DEPTH\nend", + "signature": "def overflow?", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "", + "types": [ + "Boolean" + ], + "name": null + } + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "internal_error", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Context", + "files": [ + [ + "lib/liquid/context.rb", + 263 + ] + ], + "source": "def internal_error\n # raise and catch to set backtrace and cause on exception\n raise Liquid::InternalError, 'internal'\nrescue Liquid::InternalError => exc\n exc\nend", + "signature": "def internal_error", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "squash_instance_assigns_with_environments", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Context", + "files": [ + [ + "lib/liquid/context.rb", + 270 + ] + ], + "source": "def squash_instance_assigns_with_environments\n @scopes.last.each_key do |k|\n @environments.each do |env|\n if env.key?(k)\n scopes.last[k] = lookup_and_evaluate(env, k)\n break\n end\n end\n end\nend", + "signature": "def squash_instance_assigns_with_environments", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "profiler", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ContextProfilingHook", + "files": [ + [ + "lib/liquid/profiler/hooks.rb", + 26 + ] + ], + "source": "def profiler\n @profiler\nend", + "signature": "def profiler", + "docstring": "Returns the value of attribute profiler.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "profiler=", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ContextProfilingHook", + "files": [ + [ + "lib/liquid/profiler/hooks.rb", + 26 + ] + ], + "source": "def profiler=(value)\n @profiler = value\nend", + "signature": "def profiler=(value)", + "docstring": "Sets the attribute profiler", + "dynamic": true, + "tags": [ + { + "tag_name": "param", + "text": "the value to set the attribute profiler to.", + "types": null, + "name": "value" + } + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + [ + "value", + null + ] + ], + "aliases": [ + + ] + } + ], + "constants": [ + + ], + "instance_attributes": { + "scopes": { + "read": "Liquid::Context#scopes", + "write": null + }, + "errors": { + "read": "Liquid::Context#errors", + "write": "Liquid::Context#errors=" + }, + "registers": { + "read": "Liquid::Context#registers", + "write": null + }, + "environments": { + "read": "Liquid::Context#environments", + "write": null + }, + "resource_limits": { + "read": "Liquid::Context#resource_limits", + "write": null + }, + "static_registers": { + "read": "Liquid::Context#static_registers", + "write": null + }, + "static_environments": { + "read": "Liquid::Context#static_environments", + "write": null + }, + "exception_renderer": { + "read": "Liquid::Context#exception_renderer", + "write": "Liquid::Context#exception_renderer=" + }, + "template_name": { + "read": "Liquid::Context#template_name", + "write": "Liquid::Context#template_name=" + }, + "partial": { + "read": "Liquid::Context#partial", + "write": "Liquid::Context#partial=" + }, + "global_filter": { + "read": "Liquid::Context#global_filter", + "write": "Liquid::Context#global_filter=" + }, + "strict_variables": { + "read": "Liquid::Context#strict_variables", + "write": "Liquid::Context#strict_variables=" + }, + "strict_filters": { + "read": "Liquid::Context#strict_filters", + "write": "Liquid::Context#strict_filters=" + }, + "base_scope_depth": { + "read": "Liquid::Context#base_scope_depth", + "write": "Liquid::Context#base_scope_depth=" + }, + "warnings": { + "read": "Liquid::Context#warnings", + "write": "Liquid::Context#warnings=" + }, + "strainer": { + "read": "Liquid::Context#strainer", + "write": "Liquid::Context#strainer=" + }, + "filters": { + "read": null, + "write": "Liquid::Context#filters=" + }, + "disabled_tags": { + "read": null, + "write": "Liquid::Context#disabled_tags=" + } + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + { + "type": "YARD::CodeObjects::ModuleObject", + "name": "ContextProfilingHook", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/profiler/hooks.rb", + 25 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ] + } + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "If", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/tags/if.rb", + 14 + ] + ], + "source": null, + "signature": null, + "docstring": "If is the conditional block\n\n {% if user.admin %}\n Admin user!\n {% else %}\n Not admin user\n {% endif %}\n\n There are {% if count < 5 %} less {% else %} more {% endif %} items than you need.", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "blocks", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "If", + "files": [ + [ + "lib/liquid/tags/if.rb", + 19 + ] + ], + "source": "def blocks\n @blocks\nend", + "signature": "def blocks", + "docstring": "Returns the value of attribute blocks.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "initialize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "If", + "files": [ + [ + "lib/liquid/tags/if.rb", + 21 + ] + ], + "source": "def initialize(tag_name, markup, options)\n super\n @blocks = []\n push_block('if', markup)\nend", + "signature": "def initialize(tag_name, markup, options)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "a new instance of If", + "types": [ + "If" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "tag_name", + null + ], + [ + "markup", + null + ], + [ + "options", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "nodelist", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "If", + "files": [ + [ + "lib/liquid/tags/if.rb", + 27 + ] + ], + "source": "def nodelist\n @blocks.map(&:attachment)\nend", + "signature": "def nodelist", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "If", + "files": [ + [ + "lib/liquid/tags/if.rb", + 31 + ] + ], + "source": "def parse(tokens)\n while parse_body(@blocks.last.attachment, tokens)\n end\n @blocks.reverse_each do |block|\n block.attachment.remove_blank_strings if blank?\n block.attachment.freeze\n end\nend", + "signature": "def parse(tokens)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "tokens", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "unknown_tag", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "If", + "files": [ + [ + "lib/liquid/tags/if.rb", + 43 + ] + ], + "source": "def unknown_tag(tag, markup, tokens)\n if ELSE_TAG_NAMES.include?(tag)\n push_block(tag, markup)\n else\n super\n end\nend", + "signature": "def unknown_tag(tag, markup, tokens)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "tag", + null + ], + [ + "markup", + null + ], + [ + "tokens", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "render_to_output_buffer", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "If", + "files": [ + [ + "lib/liquid/tags/if.rb", + 51 + ] + ], + "source": "def render_to_output_buffer(context, output)\n @blocks.each do |block|\n result = Liquid::Utils.to_liquid_value(\n block.evaluate(context)\n )\n\n if result\n return block.attachment.render_to_output_buffer(context, output)\n end\n end\n\n output\nend", + "signature": "def render_to_output_buffer(context, output)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "context", + null + ], + [ + "output", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "push_block", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "If", + "files": [ + [ + "lib/liquid/tags/if.rb", + 67 + ] + ], + "source": "def push_block(tag, markup)\n block = if tag == 'else'\n ElseCondition.new\n else\n parse_with_selected_parser(markup)\n end\n\n @blocks.push(block)\n block.attach(new_body)\nend", + "signature": "def push_block(tag, markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "tag", + null + ], + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_expression", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "If", + "files": [ + [ + "lib/liquid/tags/if.rb", + 78 + ] + ], + "source": "def parse_expression(markup)\n Condition.parse_expression(parse_context, markup)\nend", + "signature": "def parse_expression(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "lax_parse", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "If", + "files": [ + [ + "lib/liquid/tags/if.rb", + 82 + ] + ], + "source": "def lax_parse(markup)\n expressions = markup.scan(ExpressionsAndOperators)\n raise SyntaxError, options[:locale].t(\"errors.syntax.if\") unless expressions.pop =~ Syntax\n\n condition = Condition.new(parse_expression(Regexp.last_match(1)), Regexp.last_match(2), parse_expression(Regexp.last_match(3)))\n\n until expressions.empty?\n operator = expressions.pop.to_s.strip\n\n raise SyntaxError, options[:locale].t(\"errors.syntax.if\") unless expressions.pop.to_s =~ Syntax\n\n new_condition = Condition.new(parse_expression(Regexp.last_match(1)), Regexp.last_match(2), parse_expression(Regexp.last_match(3)))\n raise SyntaxError, options[:locale].t(\"errors.syntax.if\") unless BOOLEAN_OPERATORS.include?(operator)\n new_condition.send(operator, condition)\n condition = new_condition\n end\n\n condition\nend", + "signature": "def lax_parse(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "raise", + "text": "", + "types": [ + "SyntaxError" + ], + "name": null + } + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "strict_parse", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "If", + "files": [ + [ + "lib/liquid/tags/if.rb", + 102 + ] + ], + "source": "def strict_parse(markup)\n p = Parser.new(markup)\n condition = parse_binary_comparisons(p)\n p.consume(:end_of_string)\n condition\nend", + "signature": "def strict_parse(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_binary_comparisons", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "If", + "files": [ + [ + "lib/liquid/tags/if.rb", + 109 + ] + ], + "source": "def parse_binary_comparisons(p)\n condition = parse_comparison(p)\n first_condition = condition\n while (op = (p.id?('and') || p.id?('or')))\n child_condition = parse_comparison(p)\n condition.send(op, child_condition)\n condition = child_condition\n end\n first_condition\nend", + "signature": "def parse_binary_comparisons(p)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "p", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_comparison", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "If", + "files": [ + [ + "lib/liquid/tags/if.rb", + 120 + ] + ], + "source": "def parse_comparison(p)\n a = parse_expression(p.expression)\n if (op = p.consume?(:comparison))\n b = parse_expression(p.expression)\n Condition.new(a, op, b)\n else\n Condition.new(a)\n end\nend", + "signature": "def parse_comparison(p)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "p", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "render", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 20 + ] + ], + "source": "def render(context)\n @body.render(context)\nend", + "signature": "def render(context)", + "docstring": "For backwards compatibility", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "blank?", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 24 + ] + ], + "source": "def blank?\n @blank\nend", + "signature": "def blank?", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "", + "types": [ + "Boolean" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "raise_unknown_tag", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 37 + ] + ], + "source": "def self.raise_unknown_tag(tag, block_name, block_delimiter, parse_context)\n if tag == 'else'\n raise SyntaxError, parse_context.locale.t(\"errors.syntax.unexpected_else\",\n block_name: block_name)\n elsif tag.start_with?('end')\n raise SyntaxError, parse_context.locale.t(\"errors.syntax.invalid_delimiter\",\n tag: tag,\n block_name: block_name,\n block_delimiter: block_delimiter)\n else\n raise SyntaxError, parse_context.locale.t(\"errors.syntax.unknown_tag\", tag: tag)\n end\nend", + "signature": "def raise_unknown_tag(tag, block_name, block_delimiter, parse_context)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "api", + "text": "private", + "types": null, + "name": null + } + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "tag", + null + ], + [ + "block_name", + null + ], + [ + "block_delimiter", + null + ], + [ + "parse_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "raise_tag_never_closed", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 51 + ] + ], + "source": "def raise_tag_never_closed(block_name)\n raise SyntaxError, parse_context.locale.t(\"errors.syntax.tag_never_closed\", block_name: block_name)\nend", + "signature": "def raise_tag_never_closed(block_name)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "raise", + "text": "", + "types": [ + "SyntaxError" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "block_name", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "block_name", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 55 + ] + ], + "source": "def block_name\n @tag_name\nend", + "signature": "def block_name", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "block_delimiter", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 59 + ] + ], + "source": "def block_delimiter\n @block_delimiter ||= \"end#{block_name}\"\nend", + "signature": "def block_delimiter", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "new_body", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 66 + ] + ], + "source": "def new_body\n parse_context.new_block_body\nend", + "signature": "def new_body", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "api", + "text": "public", + "types": null, + "name": null + } + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_body", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 71 + ] + ], + "source": "def parse_body(body, tokens)\n if parse_context.depth >= MAX_DEPTH\n raise StackLevelError, \"Nesting too deep\"\n end\n parse_context.depth += 1\n begin\n body.parse(tokens, parse_context) do |end_tag_name, end_tag_params|\n @blank &&= body.blank?\n\n return false if end_tag_name == block_delimiter\n raise_tag_never_closed(block_name) unless end_tag_name\n\n # this tag is not registered with the system\n # pass it to the current block for special handling or error reporting\n unknown_tag(end_tag_name, end_tag_params, tokens)\n end\n ensure\n parse_context.depth -= 1\n end\n\n true\nend", + "signature": "def parse_body(body, tokens)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "api", + "text": "public", + "types": null, + "name": null + } + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "body", + null + ], + [ + "tokens", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "tag_name", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def tag_name\n @tag_name\nend", + "signature": "def tag_name", + "docstring": "Returns the value of attribute tag_name.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "line_number", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def line_number\n @line_number\nend", + "signature": "def line_number", + "docstring": "Returns the value of attribute line_number.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_context", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def parse_context\n @parse_context\nend", + "signature": "def parse_context", + "docstring": "Returns the value of attribute parse_context.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + "Liquid::Tag#options" + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "options", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 6 + ] + ], + "source": "def parse_context\n @parse_context\nend", + "signature": "def parse_context", + "docstring": "Returns the value of attribute parse_context.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 10 + ] + ], + "source": "def parse(tag_name, markup, tokenizer, parse_context)\n tag = new(tag_name, markup, parse_context)\n tag.parse(tokenizer)\n tag\nend", + "signature": "def parse(tag_name, markup, tokenizer, parse_context)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "tag_name", + null + ], + [ + "markup", + null + ], + [ + "tokenizer", + null + ], + [ + "parse_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "disable_tags", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 16 + ] + ], + "source": "def disable_tags(*tag_names)\n @disabled_tags ||= []\n @disabled_tags.concat(tag_names)\n prepend(Disabler)\nend", + "signature": "def disable_tags(*tag_names)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "*tag_names", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "raw", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 35 + ] + ], + "source": "def raw\n \"#{@tag_name} #{@markup}\"\nend", + "signature": "def raw", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "name", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 39 + ] + ], + "source": "def name\n self.class.name.downcase\nend", + "signature": "def name", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "strict_parse_with_error_mode_fallback", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 5 + ] + ], + "source": "def strict_parse_with_error_mode_fallback(markup)\n strict_parse_with_error_context(markup)\nrescue SyntaxError => e\n case parse_context.error_mode\n when :strict\n raise\n when :warn\n parse_context.warnings << e\n end\n lax_parse(markup)\nend", + "signature": "def strict_parse_with_error_mode_fallback(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_with_selected_parser", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 17 + ] + ], + "source": "def parse_with_selected_parser(markup)\n case parse_context.error_mode\n when :strict then strict_parse_with_error_context(markup)\n when :lax then lax_parse(markup)\n when :warn\n begin\n strict_parse_with_error_context(markup)\n rescue SyntaxError => e\n parse_context.warnings << e\n lax_parse(markup)\n end\n end\nend", + "signature": "def parse_with_selected_parser(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "strict_parse_with_error_context", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 33 + ] + ], + "source": "def strict_parse_with_error_context(markup)\n strict_parse(markup)\nrescue SyntaxError => e\n e.line_number = line_number\n e.markup_context = markup_context(markup)\n raise e\nend", + "signature": "def strict_parse_with_error_context(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "markup_context", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 41 + ] + ], + "source": "def markup_context(markup)\n \"in \\\"#{markup.strip}\\\"\"\nend", + "signature": "def markup_context(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + } + ], + "constants": [ + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "Syntax", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "If", + "files": [ + [ + "lib/liquid/tags/if.rb", + 15 + ] + ], + "source": "Syntax = /(#{QuotedFragment})\\s*([=!<>a-z_]+)?\\s*(#{QuotedFragment})?/o", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "/(#{QuotedFragment})\\s*([=!<>a-z_]+)?\\s*(#{QuotedFragment})?/o" + }, + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "ExpressionsAndOperators", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "If", + "files": [ + [ + "lib/liquid/tags/if.rb", + 16 + ] + ], + "source": "ExpressionsAndOperators = /(?:\\b(?:\\s?and\\s?|\\s?or\\s?)\\b|(?:\\s*(?!\\b(?:\\s?and\\s?|\\s?or\\s?)\\b)(?:#{QuotedFragment}|\\S+)\\s*)+)/o", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "/(?:\\b(?:\\s?and\\s?|\\s?or\\s?)\\b|(?:\\s*(?!\\b(?:\\s?and\\s?|\\s?or\\s?)\\b)(?:#{QuotedFragment}|\\S+)\\s*)+)/o" + }, + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "BOOLEAN_OPERATORS", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "If", + "files": [ + [ + "lib/liquid/tags/if.rb", + 17 + ] + ], + "source": "BOOLEAN_OPERATORS = %w(and or).freeze", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "%w(and or).freeze" + }, + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "ELSE_TAG_NAMES", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "If", + "files": [ + [ + "lib/liquid/tags/if.rb", + 40 + ] + ], + "source": "ELSE_TAG_NAMES = ['elsif', 'else'].freeze", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "['elsif', 'else'].freeze" + }, + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "MAX_DEPTH", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 5 + ] + ], + "source": "MAX_DEPTH = 100", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "100" + } + ], + "instance_attributes": { + "blocks": { + "read": "Liquid::If#blocks", + "write": null + } + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "ParseTreeVisitor", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "If", + "files": [ + [ + "lib/liquid/tags/if.rb", + 130 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "children", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/tags/if.rb", + 131 + ] + ], + "source": "def children\n @node.blocks\nend", + "signature": "def children", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "for", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/parse_tree_visitor.rb", + 5 + ] + ], + "source": "def self.for(node, callbacks = Hash.new(proc {}))\n if defined?(node.class::ParseTreeVisitor)\n node.class::ParseTreeVisitor\n else\n self\n end.new(node, callbacks)\nend", + "signature": "def for(node, callbacks = Hash.new(proc {}))", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "node", + null + ], + [ + "callbacks", + "Hash.new(proc {})" + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "initialize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/parse_tree_visitor.rb", + 13 + ] + ], + "source": "def initialize(node, callbacks)\n @node = node\n @callbacks = callbacks\nend", + "signature": "def initialize(node, callbacks)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "a new instance of ParseTreeVisitor", + "types": [ + "ParseTreeVisitor" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "node", + null + ], + [ + "callbacks", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "add_callback_for", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/parse_tree_visitor.rb", + 18 + ] + ], + "source": "def add_callback_for(*classes, &block)\n callback = block\n callback = ->(node, _) { yield node } if block.arity.abs == 1\n callback = ->(_, _) { yield } if block.arity.zero?\n classes.each { |klass| @callbacks[klass] = callback }\n self\nend", + "signature": "def add_callback_for(*classes, &block)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "*classes", + null + ], + [ + "&block", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "visit", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/parse_tree_visitor.rb", + 26 + ] + ], + "source": "def visit(context = nil)\n children.map do |node|\n item, new_context = @callbacks[node.class].call(node, context)\n [\n item,\n ParseTreeVisitor.for(node, @callbacks).visit(new_context || context),\n ]\n end\nend", + "signature": "def visit(context = nil)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "context", + "nil" + ] + ], + "aliases": [ + + ] + } + ], + "constants": [ + + ], + "instance_attributes": { + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "Document", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/document.rb", + 4 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Document", + "files": [ + [ + "lib/liquid/document.rb", + 5 + ] + ], + "source": "def self.parse(tokens, parse_context)\n doc = new(parse_context)\n doc.parse(tokens, parse_context)\n doc\nend", + "signature": "def parse(tokens, parse_context)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "tokens", + null + ], + [ + "parse_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_context", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Document", + "files": [ + [ + "lib/liquid/document.rb", + 11 + ] + ], + "source": "def parse_context\n @parse_context\nend", + "signature": "def parse_context", + "docstring": "Returns the value of attribute parse_context.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "body", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Document", + "files": [ + [ + "lib/liquid/document.rb", + 11 + ] + ], + "source": "def body\n @body\nend", + "signature": "def body", + "docstring": "Returns the value of attribute body.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "initialize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Document", + "files": [ + [ + "lib/liquid/document.rb", + 13 + ] + ], + "source": "def initialize(parse_context)\n @parse_context = parse_context\n @body = new_body\nend", + "signature": "def initialize(parse_context)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "a new instance of Document", + "types": [ + "Document" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "parse_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "nodelist", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Document", + "files": [ + [ + "lib/liquid/document.rb", + 18 + ] + ], + "source": "def nodelist\n @body.nodelist\nend", + "signature": "def nodelist", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Document", + "files": [ + [ + "lib/liquid/document.rb", + 22 + ] + ], + "source": "def parse(tokenizer, parse_context)\n while parse_body(tokenizer)\n end\n @body.freeze\nrescue SyntaxError => e\n e.line_number ||= parse_context.line_number\n raise\nend", + "signature": "def parse(tokenizer, parse_context)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "tokenizer", + null + ], + [ + "parse_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "unknown_tag", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Document", + "files": [ + [ + "lib/liquid/document.rb", + 31 + ] + ], + "source": "def unknown_tag(tag, _markup, _tokenizer)\n case tag\n when 'else', 'end'\n raise SyntaxError, parse_context.locale.t(\"errors.syntax.unexpected_outer_tag\", tag: tag)\n else\n raise SyntaxError, parse_context.locale.t(\"errors.syntax.unknown_tag\", tag: tag)\n end\nend", + "signature": "def unknown_tag(tag, _markup, _tokenizer)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "tag", + null + ], + [ + "_markup", + null + ], + [ + "_tokenizer", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "render_to_output_buffer", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Document", + "files": [ + [ + "lib/liquid/document.rb", + 40 + ] + ], + "source": "def render_to_output_buffer(context, output)\n @body.render_to_output_buffer(context, output)\nend", + "signature": "def render_to_output_buffer(context, output)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "context", + null + ], + [ + "output", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "render", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Document", + "files": [ + [ + "lib/liquid/document.rb", + 44 + ] + ], + "source": "def render(context)\n render_to_output_buffer(context, +'')\nend", + "signature": "def render(context)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "new_body", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Document", + "files": [ + [ + "lib/liquid/document.rb", + 50 + ] + ], + "source": "def new_body\n parse_context.new_block_body\nend", + "signature": "def new_body", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_body", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Document", + "files": [ + [ + "lib/liquid/document.rb", + 54 + ] + ], + "source": "def parse_body(tokenizer)\n @body.parse(tokenizer, parse_context) do |unknown_tag_name, unknown_tag_markup|\n if unknown_tag_name\n unknown_tag(unknown_tag_name, unknown_tag_markup, tokenizer)\n true\n else\n false\n end\n end\nend", + "signature": "def parse_body(tokenizer)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "tokenizer", + null + ] + ], + "aliases": [ + + ] + } + ], + "constants": [ + + ], + "instance_attributes": { + "parse_context": { + "read": "Liquid::Document#parse_context", + "write": null + }, + "body": { + "read": "Liquid::Document#body", + "write": null + } + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + { + "type": "YARD::CodeObjects::ModuleObject", + "name": "DocumentProfilingHook", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/profiler/hooks.rb", + 17 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ] + } + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "Profiler", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/profiler.rb", + 45 + ] + ], + "source": null, + "signature": null, + "docstring": "Profiler enables support for profiling template rendering to help track down performance issues.\n\nTo enable profiling, first require 'liquid/profiler'.\nThen, to profile a parse/render cycle, pass the profile: true option to Liquid::Template.parse.\nAfter Liquid::Template#render is called, the template object makes available an instance of this\nclass via the Liquid::Template#profiler method.\n\n template = Liquid::Template.parse(template_content, profile: true)\n output = template.render\n profile = template.profiler\n\nThis object contains all profiling information, containing information on what tags were rendered,\nwhere in the templates these tags live, and how long each tag took to render.\n\nThis is a tree structure that is Enumerable all the way down, and keeps track of tags and rendering times\ninside of {% include %} tags.\n\n profile.each do |node|\n # Access to the node itself\n node.code\n\n # Which template and line number of this node.\n # The top-level template name is `nil` by default, but can be set in the Liquid::Context before rendering.\n node.partial\n node.line_number\n\n # Render time in seconds of this node\n node.render_time\n\n # If the template used {% include %}, this node will also have children.\n node.children.each do |child2|\n # ...\n end\n end\n\nProfiler also exposes the total time of the template's render in Liquid::Profiler#total_render_time.\n\nAll render times are in seconds. There is a small performance hit when profiling is enabled.", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "total_time", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Profiler", + "files": [ + [ + "lib/liquid/profiler.rb", + 72 + ] + ], + "source": "def total_time\n @total_time\nend", + "signature": "def total_time", + "docstring": "Returns the value of attribute total_time.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + "Liquid::Profiler#total_render_time" + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "total_render_time", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Profiler", + "files": [ + [ + "lib/liquid/profiler.rb", + 73 + ] + ], + "source": "def total_time\n @total_time\nend", + "signature": "def total_time", + "docstring": "Returns the value of attribute total_time.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "initialize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Profiler", + "files": [ + [ + "lib/liquid/profiler.rb", + 75 + ] + ], + "source": "def initialize\n @root_children = []\n @current_children = nil\n @total_time = 0.0\nend", + "signature": "def initialize", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "a new instance of Profiler", + "types": [ + "Profiler" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "profile", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Profiler", + "files": [ + [ + "lib/liquid/profiler.rb", + 81 + ] + ], + "source": "def profile(template_name, &block)\n # nested renders are done from a tag that already has a timing node\n return yield if @current_children\n\n root_children = @root_children\n render_idx = root_children.length\n begin\n @current_children = root_children\n profile_node(template_name, &block)\n ensure\n @current_children = nil\n if (timing = root_children[render_idx])\n @total_time += timing.total_time\n end\n end\nend", + "signature": "def profile(template_name, &block)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "template_name", + null + ], + [ + "&block", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "children", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Profiler", + "files": [ + [ + "lib/liquid/profiler.rb", + 98 + ] + ], + "source": "def children\n children = @root_children\n if children.length == 1\n children.first.children\n else\n children\n end\nend", + "signature": "def children", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "each", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Profiler", + "files": [ + [ + "lib/liquid/profiler.rb", + 107 + ] + ], + "source": "def each(&block)\n children.each(&block)\nend", + "signature": "def each(&block)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "&block", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "[]", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Profiler", + "files": [ + [ + "lib/liquid/profiler.rb", + 111 + ] + ], + "source": "def [](idx)\n children[idx]\nend", + "signature": "def [](idx)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "idx", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "length", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Profiler", + "files": [ + [ + "lib/liquid/profiler.rb", + 115 + ] + ], + "source": "def length\n children.length\nend", + "signature": "def length", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "profile_node", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Profiler", + "files": [ + [ + "lib/liquid/profiler.rb", + 119 + ] + ], + "source": "def profile_node(template_name, code: nil, line_number: nil)\n timing = Timing.new(code: code, template_name: template_name, line_number: line_number)\n parent_children = @current_children\n start_time = monotonic_time\n begin\n @current_children = timing.children\n yield\n ensure\n @current_children = parent_children\n timing.total_time = monotonic_time - start_time\n parent_children << timing\n end\nend", + "signature": "def profile_node(template_name, code: nil, line_number: nil)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "template_name", + null + ], + [ + "code:", + "nil" + ], + [ + "line_number:", + "nil" + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "monotonic_time", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Profiler", + "files": [ + [ + "lib/liquid/profiler.rb", + 135 + ] + ], + "source": "def monotonic_time\n Process.clock_gettime(Process::CLOCK_MONOTONIC)\nend", + "signature": "def monotonic_time", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + } + ], + "constants": [ + + ], + "instance_attributes": { + "total_time": { + "read": "Liquid::Profiler#total_time", + "write": null + } + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + null + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "Timing", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Profiler", + "files": [ + [ + "lib/liquid/profiler.rb", + 48 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "code", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Timing", + "files": [ + [ + "lib/liquid/profiler.rb", + 49 + ] + ], + "source": "def code\n @code\nend", + "signature": "def code", + "docstring": "Returns the value of attribute code.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "template_name", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Timing", + "files": [ + [ + "lib/liquid/profiler.rb", + 49 + ] + ], + "source": "def template_name\n @template_name\nend", + "signature": "def template_name", + "docstring": "Returns the value of attribute template_name.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + "Liquid::Profiler::Timing#partial" + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "line_number", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Timing", + "files": [ + [ + "lib/liquid/profiler.rb", + 49 + ] + ], + "source": "def line_number\n @line_number\nend", + "signature": "def line_number", + "docstring": "Returns the value of attribute line_number.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "children", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Timing", + "files": [ + [ + "lib/liquid/profiler.rb", + 49 + ] + ], + "source": "def children\n @children\nend", + "signature": "def children", + "docstring": "Returns the value of attribute children.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "total_time", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Timing", + "files": [ + [ + "lib/liquid/profiler.rb", + 50 + ] + ], + "source": "def total_time\n @total_time\nend", + "signature": "def total_time", + "docstring": "Returns the value of attribute total_time.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + "Liquid::Profiler::Timing#render_time" + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "total_time=", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Timing", + "files": [ + [ + "lib/liquid/profiler.rb", + 50 + ] + ], + "source": "def total_time=(value)\n @total_time = value\nend", + "signature": "def total_time=(value)", + "docstring": "Sets the attribute total_time", + "dynamic": true, + "tags": [ + { + "tag_name": "param", + "text": "the value to set the attribute total_time to.", + "types": null, + "name": "value" + } + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + [ + "value", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "render_time", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Timing", + "files": [ + [ + "lib/liquid/profiler.rb", + 51 + ] + ], + "source": "def total_time\n @total_time\nend", + "signature": "def total_time", + "docstring": "Returns the value of attribute total_time.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "partial", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Timing", + "files": [ + [ + "lib/liquid/profiler.rb", + 52 + ] + ], + "source": "def template_name\n @template_name\nend", + "signature": "def template_name", + "docstring": "Returns the value of attribute template_name.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "initialize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Timing", + "files": [ + [ + "lib/liquid/profiler.rb", + 54 + ] + ], + "source": "def initialize(code: nil, template_name: nil, line_number: nil)\n @code = code\n @template_name = template_name\n @line_number = line_number\n @children = []\nend", + "signature": "def initialize(code: nil, template_name: nil, line_number: nil)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "a new instance of Timing", + "types": [ + "Timing" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "code:", + "nil" + ], + [ + "template_name:", + "nil" + ], + [ + "line_number:", + "nil" + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "self_time", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Timing", + "files": [ + [ + "lib/liquid/profiler.rb", + 61 + ] + ], + "source": "def self_time\n @self_time ||= begin\n total_children_time = 0.0\n @children.each do |child|\n total_children_time += child.total_time\n end\n @total_time - total_children_time\n end\nend", + "signature": "def self_time", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + } + ], + "constants": [ + + ], + "instance_attributes": { + "code": { + "read": "Liquid::Profiler::Timing#code", + "write": null + }, + "template_name": { + "read": "Liquid::Profiler::Timing#template_name", + "write": null + }, + "line_number": { + "read": "Liquid::Profiler::Timing#line_number", + "write": null + }, + "children": { + "read": "Liquid::Profiler::Timing#children", + "write": null + }, + "total_time": { + "read": "Liquid::Profiler::Timing#total_time", + "write": "Liquid::Profiler::Timing#total_time=" + } + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "Register", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/register.rb", + 4 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + + ], + "constants": [ + + ], + "instance_attributes": { + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "For", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/tags/for.rb", + 48 + ] + ], + "source": null, + "signature": null, + "docstring": "\"For\" iterates over an array or collection.\nSeveral useful variables are available to you within the loop.\n\n== Basic usage:\n {% for item in collection %}\n {{ forloop.index }}: {{ item.name }}\n {% endfor %}\n\n== Advanced usage:\n {% for item in collection %}\n
\n Item {{ forloop.index }}: {{ item.name }}\n
\n {% else %}\n There is nothing in the collection.\n {% endfor %}\n\nYou can also define a limit and offset much like SQL. Remember\nthat offset starts at 0 for the first item.\n\n {% for item in collection limit:5 offset:10 %}\n {{ item.name }}\n {% end %}\n\n To reverse the for loop simply use {% for item in collection reversed %} (note that the flag's spelling is different to the filter `reverse`)\n\n== Available variables:\n\nforloop.name:: 'item-collection'\nforloop.length:: Length of the loop\nforloop.index:: The current item's position in the collection;\n forloop.index starts at 1.\n This is helpful for non-programmers who start believe\n the first item in an array is 1, not 0.\nforloop.index0:: The current item's position in the collection\n where the first item is 0\nforloop.rindex:: Number of items remaining in the loop\n (length - index) where 1 is the last item.\nforloop.rindex0:: Number of items remaining in the loop\n where 0 is the last item.\nforloop.first:: Returns true if the item is the first item.\nforloop.last:: Returns true if the item is the last item.\nforloop.parentloop:: Provides access to the parent loop, if present.", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "collection_name", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "For", + "files": [ + [ + "lib/liquid/tags/for.rb", + 51 + ] + ], + "source": "def collection_name\n @collection_name\nend", + "signature": "def collection_name", + "docstring": "Returns the value of attribute collection_name.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "variable_name", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "For", + "files": [ + [ + "lib/liquid/tags/for.rb", + 51 + ] + ], + "source": "def variable_name\n @variable_name\nend", + "signature": "def variable_name", + "docstring": "Returns the value of attribute variable_name.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "limit", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "For", + "files": [ + [ + "lib/liquid/tags/for.rb", + 51 + ] + ], + "source": "def limit\n @limit\nend", + "signature": "def limit", + "docstring": "Returns the value of attribute limit.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "from", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "For", + "files": [ + [ + "lib/liquid/tags/for.rb", + 51 + ] + ], + "source": "def from\n @from\nend", + "signature": "def from", + "docstring": "Returns the value of attribute from.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "initialize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "For", + "files": [ + [ + "lib/liquid/tags/for.rb", + 53 + ] + ], + "source": "def initialize(tag_name, markup, options)\n super\n @from = @limit = nil\n parse_with_selected_parser(markup)\n @for_block = new_body\n @else_block = nil\nend", + "signature": "def initialize(tag_name, markup, options)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "a new instance of For", + "types": [ + "For" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "tag_name", + null + ], + [ + "markup", + null + ], + [ + "options", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "For", + "files": [ + [ + "lib/liquid/tags/for.rb", + 61 + ] + ], + "source": "def parse(tokens)\n if parse_body(@for_block, tokens)\n parse_body(@else_block, tokens)\n end\n if blank?\n @else_block&.remove_blank_strings\n @for_block.remove_blank_strings\n end\n @else_block&.freeze\n @for_block.freeze\nend", + "signature": "def parse(tokens)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "tokens", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "nodelist", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "For", + "files": [ + [ + "lib/liquid/tags/for.rb", + 73 + ] + ], + "source": "def nodelist\n @else_block ? [@for_block, @else_block] : [@for_block]\nend", + "signature": "def nodelist", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "unknown_tag", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "For", + "files": [ + [ + "lib/liquid/tags/for.rb", + 77 + ] + ], + "source": "def unknown_tag(tag, markup, tokens)\n return super unless tag == 'else'\n @else_block = new_body\nend", + "signature": "def unknown_tag(tag, markup, tokens)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "tag", + null + ], + [ + "markup", + null + ], + [ + "tokens", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "render_to_output_buffer", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "For", + "files": [ + [ + "lib/liquid/tags/for.rb", + 82 + ] + ], + "source": "def render_to_output_buffer(context, output)\n segment = collection_segment(context)\n\n if segment.empty?\n render_else(context, output)\n else\n render_segment(context, output, segment)\n end\n\n output\nend", + "signature": "def render_to_output_buffer(context, output)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "context", + null + ], + [ + "output", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "lax_parse", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "For", + "files": [ + [ + "lib/liquid/tags/for.rb", + 96 + ] + ], + "source": "def lax_parse(markup)\n if markup =~ Syntax\n @variable_name = Regexp.last_match(1)\n collection_name = Regexp.last_match(2)\n @reversed = !!Regexp.last_match(3)\n @name = \"#{@variable_name}-#{collection_name}\"\n @collection_name = parse_expression(collection_name)\n markup.scan(TagAttributes) do |key, value|\n set_attribute(key, value)\n end\n else\n raise SyntaxError, options[:locale].t(\"errors.syntax.for\")\n end\nend", + "signature": "def lax_parse(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "protected", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "strict_parse", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "For", + "files": [ + [ + "lib/liquid/tags/for.rb", + 111 + ] + ], + "source": "def strict_parse(markup)\n p = Parser.new(markup)\n @variable_name = p.consume(:id)\n raise SyntaxError, options[:locale].t(\"errors.syntax.for_invalid_in\") unless p.id?('in')\n\n collection_name = p.expression\n @collection_name = parse_expression(collection_name)\n\n @name = \"#{@variable_name}-#{collection_name}\"\n @reversed = p.id?('reversed')\n\n while p.look(:id) && p.look(:colon, 1)\n unless (attribute = p.id?('limit') || p.id?('offset'))\n raise SyntaxError, options[:locale].t(\"errors.syntax.for_invalid_attribute\")\n end\n p.consume\n set_attribute(attribute, p.expression)\n end\n p.consume(:end_of_string)\nend", + "signature": "def strict_parse(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "raise", + "text": "", + "types": [ + "SyntaxError" + ], + "name": null + } + ], + "visibility": "protected", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "collection_segment", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "For", + "files": [ + [ + "lib/liquid/tags/for.rb", + 134 + ] + ], + "source": "def collection_segment(context)\n offsets = context.registers[:for] ||= {}\n\n from = if @from == :continue\n offsets[@name].to_i\n else\n from_value = context.evaluate(@from)\n if from_value.nil?\n 0\n else\n Utils.to_integer(from_value)\n end\n end\n\n collection = context.evaluate(@collection_name)\n collection = collection.to_a if collection.is_a?(Range)\n\n limit_value = context.evaluate(@limit)\n to = if limit_value.nil?\n nil\n else\n Utils.to_integer(limit_value) + from\n end\n\n segment = Utils.slice_collection(collection, from, to)\n segment.reverse! if @reversed\n\n offsets[@name] = from + segment.length\n\n segment\nend", + "signature": "def collection_segment(context)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "render_segment", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "For", + "files": [ + [ + "lib/liquid/tags/for.rb", + 166 + ] + ], + "source": "def render_segment(context, output, segment)\n for_stack = context.registers[:for_stack] ||= []\n length = segment.length\n\n context.stack do\n loop_vars = Liquid::ForloopDrop.new(@name, length, for_stack[-1])\n\n for_stack.push(loop_vars)\n\n begin\n context['forloop'] = loop_vars\n\n segment.each do |item|\n context[@variable_name] = item\n @for_block.render_to_output_buffer(context, output)\n loop_vars.send(:increment!)\n\n # Handle any interrupts if they exist.\n next unless context.interrupt?\n interrupt = context.pop_interrupt\n break if interrupt.is_a?(BreakInterrupt)\n next if interrupt.is_a?(ContinueInterrupt)\n end\n ensure\n for_stack.pop\n end\n end\n\n output\nend", + "signature": "def render_segment(context, output, segment)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "context", + null + ], + [ + "output", + null + ], + [ + "segment", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "set_attribute", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "For", + "files": [ + [ + "lib/liquid/tags/for.rb", + 197 + ] + ], + "source": "def set_attribute(key, expr)\n case key\n when 'offset'\n @from = if expr == 'continue'\n Usage.increment('for_offset_continue')\n :continue\n else\n parse_expression(expr)\n end\n when 'limit'\n @limit = parse_expression(expr)\n end\nend", + "signature": "def set_attribute(key, expr)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "key", + null + ], + [ + "expr", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "render_else", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "For", + "files": [ + [ + "lib/liquid/tags/for.rb", + 211 + ] + ], + "source": "def render_else(context, output)\n if @else_block\n @else_block.render_to_output_buffer(context, output)\n else\n output\n end\nend", + "signature": "def render_else(context, output)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "context", + null + ], + [ + "output", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "render", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 20 + ] + ], + "source": "def render(context)\n @body.render(context)\nend", + "signature": "def render(context)", + "docstring": "For backwards compatibility", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "blank?", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 24 + ] + ], + "source": "def blank?\n @blank\nend", + "signature": "def blank?", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "", + "types": [ + "Boolean" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "raise_unknown_tag", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 37 + ] + ], + "source": "def self.raise_unknown_tag(tag, block_name, block_delimiter, parse_context)\n if tag == 'else'\n raise SyntaxError, parse_context.locale.t(\"errors.syntax.unexpected_else\",\n block_name: block_name)\n elsif tag.start_with?('end')\n raise SyntaxError, parse_context.locale.t(\"errors.syntax.invalid_delimiter\",\n tag: tag,\n block_name: block_name,\n block_delimiter: block_delimiter)\n else\n raise SyntaxError, parse_context.locale.t(\"errors.syntax.unknown_tag\", tag: tag)\n end\nend", + "signature": "def raise_unknown_tag(tag, block_name, block_delimiter, parse_context)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "api", + "text": "private", + "types": null, + "name": null + } + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "tag", + null + ], + [ + "block_name", + null + ], + [ + "block_delimiter", + null + ], + [ + "parse_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "raise_tag_never_closed", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 51 + ] + ], + "source": "def raise_tag_never_closed(block_name)\n raise SyntaxError, parse_context.locale.t(\"errors.syntax.tag_never_closed\", block_name: block_name)\nend", + "signature": "def raise_tag_never_closed(block_name)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "raise", + "text": "", + "types": [ + "SyntaxError" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "block_name", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "block_name", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 55 + ] + ], + "source": "def block_name\n @tag_name\nend", + "signature": "def block_name", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "block_delimiter", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 59 + ] + ], + "source": "def block_delimiter\n @block_delimiter ||= \"end#{block_name}\"\nend", + "signature": "def block_delimiter", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "new_body", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 66 + ] + ], + "source": "def new_body\n parse_context.new_block_body\nend", + "signature": "def new_body", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "api", + "text": "public", + "types": null, + "name": null + } + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_body", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 71 + ] + ], + "source": "def parse_body(body, tokens)\n if parse_context.depth >= MAX_DEPTH\n raise StackLevelError, \"Nesting too deep\"\n end\n parse_context.depth += 1\n begin\n body.parse(tokens, parse_context) do |end_tag_name, end_tag_params|\n @blank &&= body.blank?\n\n return false if end_tag_name == block_delimiter\n raise_tag_never_closed(block_name) unless end_tag_name\n\n # this tag is not registered with the system\n # pass it to the current block for special handling or error reporting\n unknown_tag(end_tag_name, end_tag_params, tokens)\n end\n ensure\n parse_context.depth -= 1\n end\n\n true\nend", + "signature": "def parse_body(body, tokens)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "api", + "text": "public", + "types": null, + "name": null + } + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "body", + null + ], + [ + "tokens", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "tag_name", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def tag_name\n @tag_name\nend", + "signature": "def tag_name", + "docstring": "Returns the value of attribute tag_name.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "line_number", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def line_number\n @line_number\nend", + "signature": "def line_number", + "docstring": "Returns the value of attribute line_number.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_context", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def parse_context\n @parse_context\nend", + "signature": "def parse_context", + "docstring": "Returns the value of attribute parse_context.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + "Liquid::Tag#options" + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "options", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 6 + ] + ], + "source": "def parse_context\n @parse_context\nend", + "signature": "def parse_context", + "docstring": "Returns the value of attribute parse_context.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 10 + ] + ], + "source": "def parse(tag_name, markup, tokenizer, parse_context)\n tag = new(tag_name, markup, parse_context)\n tag.parse(tokenizer)\n tag\nend", + "signature": "def parse(tag_name, markup, tokenizer, parse_context)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "tag_name", + null + ], + [ + "markup", + null + ], + [ + "tokenizer", + null + ], + [ + "parse_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "disable_tags", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 16 + ] + ], + "source": "def disable_tags(*tag_names)\n @disabled_tags ||= []\n @disabled_tags.concat(tag_names)\n prepend(Disabler)\nend", + "signature": "def disable_tags(*tag_names)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "*tag_names", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "raw", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 35 + ] + ], + "source": "def raw\n \"#{@tag_name} #{@markup}\"\nend", + "signature": "def raw", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "name", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 39 + ] + ], + "source": "def name\n self.class.name.downcase\nend", + "signature": "def name", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_expression", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 61 + ] + ], + "source": "def parse_expression(markup)\n parse_context.parse_expression(markup)\nend", + "signature": "def parse_expression(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "strict_parse_with_error_mode_fallback", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 5 + ] + ], + "source": "def strict_parse_with_error_mode_fallback(markup)\n strict_parse_with_error_context(markup)\nrescue SyntaxError => e\n case parse_context.error_mode\n when :strict\n raise\n when :warn\n parse_context.warnings << e\n end\n lax_parse(markup)\nend", + "signature": "def strict_parse_with_error_mode_fallback(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_with_selected_parser", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 17 + ] + ], + "source": "def parse_with_selected_parser(markup)\n case parse_context.error_mode\n when :strict then strict_parse_with_error_context(markup)\n when :lax then lax_parse(markup)\n when :warn\n begin\n strict_parse_with_error_context(markup)\n rescue SyntaxError => e\n parse_context.warnings << e\n lax_parse(markup)\n end\n end\nend", + "signature": "def parse_with_selected_parser(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "strict_parse_with_error_context", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 33 + ] + ], + "source": "def strict_parse_with_error_context(markup)\n strict_parse(markup)\nrescue SyntaxError => e\n e.line_number = line_number\n e.markup_context = markup_context(markup)\n raise e\nend", + "signature": "def strict_parse_with_error_context(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "markup_context", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 41 + ] + ], + "source": "def markup_context(markup)\n \"in \\\"#{markup.strip}\\\"\"\nend", + "signature": "def markup_context(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + } + ], + "constants": [ + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "Syntax", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "For", + "files": [ + [ + "lib/liquid/tags/for.rb", + 49 + ] + ], + "source": "Syntax = /\\A(#{VariableSegment}+)\\s+in\\s+(#{QuotedFragment}+)\\s*(reversed)?/o", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "/\\A(#{VariableSegment}+)\\s+in\\s+(#{QuotedFragment}+)\\s*(reversed)?/o" + }, + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "MAX_DEPTH", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 5 + ] + ], + "source": "MAX_DEPTH = 100", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "100" + } + ], + "instance_attributes": { + "collection_name": { + "read": "Liquid::For#collection_name", + "write": null + }, + "variable_name": { + "read": "Liquid::For#variable_name", + "write": null + }, + "limit": { + "read": "Liquid::For#limit", + "write": null + }, + "from": { + "read": "Liquid::For#from", + "write": null + } + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "ParseTreeVisitor", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "For", + "files": [ + [ + "lib/liquid/tags/for.rb", + 219 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "children", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/tags/for.rb", + 220 + ] + ], + "source": "def children\n (super + [@node.limit, @node.from, @node.collection_name]).compact\nend", + "signature": "def children", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "for", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/parse_tree_visitor.rb", + 5 + ] + ], + "source": "def self.for(node, callbacks = Hash.new(proc {}))\n if defined?(node.class::ParseTreeVisitor)\n node.class::ParseTreeVisitor\n else\n self\n end.new(node, callbacks)\nend", + "signature": "def for(node, callbacks = Hash.new(proc {}))", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "node", + null + ], + [ + "callbacks", + "Hash.new(proc {})" + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "initialize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/parse_tree_visitor.rb", + 13 + ] + ], + "source": "def initialize(node, callbacks)\n @node = node\n @callbacks = callbacks\nend", + "signature": "def initialize(node, callbacks)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "a new instance of ParseTreeVisitor", + "types": [ + "ParseTreeVisitor" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "node", + null + ], + [ + "callbacks", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "add_callback_for", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/parse_tree_visitor.rb", + 18 + ] + ], + "source": "def add_callback_for(*classes, &block)\n callback = block\n callback = ->(node, _) { yield node } if block.arity.abs == 1\n callback = ->(_, _) { yield } if block.arity.zero?\n classes.each { |klass| @callbacks[klass] = callback }\n self\nend", + "signature": "def add_callback_for(*classes, &block)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "*classes", + null + ], + [ + "&block", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "visit", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/parse_tree_visitor.rb", + 26 + ] + ], + "source": "def visit(context = nil)\n children.map do |node|\n item, new_context = @callbacks[node.class].call(node, context)\n [\n item,\n ParseTreeVisitor.for(node, @callbacks).visit(new_context || context),\n ]\n end\nend", + "signature": "def visit(context = nil)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "context", + "nil" + ] + ], + "aliases": [ + + ] + } + ], + "constants": [ + + ], + "instance_attributes": { + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "Raw", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/tags/raw.rb", + 4 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "initialize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Raw", + "files": [ + [ + "lib/liquid/tags/raw.rb", + 8 + ] + ], + "source": "def initialize(tag_name, markup, parse_context)\n super\n\n ensure_valid_markup(tag_name, markup, parse_context)\nend", + "signature": "def initialize(tag_name, markup, parse_context)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "a new instance of Raw", + "types": [ + "Raw" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "tag_name", + null + ], + [ + "markup", + null + ], + [ + "parse_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Raw", + "files": [ + [ + "lib/liquid/tags/raw.rb", + 14 + ] + ], + "source": "def parse(tokens)\n @body = +''\n while (token = tokens.shift)\n if token =~ FullTokenPossiblyInvalid && block_delimiter == Regexp.last_match(2)\n @body << Regexp.last_match(1) if Regexp.last_match(1) != \"\"\n return\n end\n @body << token unless token.empty?\n end\n\n raise_tag_never_closed(block_name)\nend", + "signature": "def parse(tokens)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "tokens", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "render_to_output_buffer", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Raw", + "files": [ + [ + "lib/liquid/tags/raw.rb", + 27 + ] + ], + "source": "def render_to_output_buffer(_context, output)\n output << @body\n output\nend", + "signature": "def render_to_output_buffer(_context, output)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "_context", + null + ], + [ + "output", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "nodelist", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Raw", + "files": [ + [ + "lib/liquid/tags/raw.rb", + 32 + ] + ], + "source": "def nodelist\n [@body]\nend", + "signature": "def nodelist", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "blank?", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Raw", + "files": [ + [ + "lib/liquid/tags/raw.rb", + 36 + ] + ], + "source": "def blank?\n @body.empty?\nend", + "signature": "def blank?", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "", + "types": [ + "Boolean" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "ensure_valid_markup", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Raw", + "files": [ + [ + "lib/liquid/tags/raw.rb", + 42 + ] + ], + "source": "def ensure_valid_markup(tag_name, markup, parse_context)\n unless Syntax.match?(markup)\n raise SyntaxError, parse_context.locale.t(\"errors.syntax.tag_unexpected_args\", tag: tag_name)\n end\nend", + "signature": "def ensure_valid_markup(tag_name, markup, parse_context)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "protected", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "tag_name", + null + ], + [ + "markup", + null + ], + [ + "parse_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "render", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 20 + ] + ], + "source": "def render(context)\n @body.render(context)\nend", + "signature": "def render(context)", + "docstring": "For backwards compatibility", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "unknown_tag", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 32 + ] + ], + "source": "def unknown_tag(tag_name, _markup, _tokenizer)\n Block.raise_unknown_tag(tag_name, block_name, block_delimiter, parse_context)\nend", + "signature": "def unknown_tag(tag_name, _markup, _tokenizer)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "tag_name", + null + ], + [ + "_markup", + null + ], + [ + "_tokenizer", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "raise_unknown_tag", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 37 + ] + ], + "source": "def self.raise_unknown_tag(tag, block_name, block_delimiter, parse_context)\n if tag == 'else'\n raise SyntaxError, parse_context.locale.t(\"errors.syntax.unexpected_else\",\n block_name: block_name)\n elsif tag.start_with?('end')\n raise SyntaxError, parse_context.locale.t(\"errors.syntax.invalid_delimiter\",\n tag: tag,\n block_name: block_name,\n block_delimiter: block_delimiter)\n else\n raise SyntaxError, parse_context.locale.t(\"errors.syntax.unknown_tag\", tag: tag)\n end\nend", + "signature": "def raise_unknown_tag(tag, block_name, block_delimiter, parse_context)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "api", + "text": "private", + "types": null, + "name": null + } + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "tag", + null + ], + [ + "block_name", + null + ], + [ + "block_delimiter", + null + ], + [ + "parse_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "raise_tag_never_closed", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 51 + ] + ], + "source": "def raise_tag_never_closed(block_name)\n raise SyntaxError, parse_context.locale.t(\"errors.syntax.tag_never_closed\", block_name: block_name)\nend", + "signature": "def raise_tag_never_closed(block_name)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "raise", + "text": "", + "types": [ + "SyntaxError" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "block_name", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "block_name", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 55 + ] + ], + "source": "def block_name\n @tag_name\nend", + "signature": "def block_name", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "block_delimiter", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 59 + ] + ], + "source": "def block_delimiter\n @block_delimiter ||= \"end#{block_name}\"\nend", + "signature": "def block_delimiter", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "new_body", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 66 + ] + ], + "source": "def new_body\n parse_context.new_block_body\nend", + "signature": "def new_body", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "api", + "text": "public", + "types": null, + "name": null + } + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_body", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 71 + ] + ], + "source": "def parse_body(body, tokens)\n if parse_context.depth >= MAX_DEPTH\n raise StackLevelError, \"Nesting too deep\"\n end\n parse_context.depth += 1\n begin\n body.parse(tokens, parse_context) do |end_tag_name, end_tag_params|\n @blank &&= body.blank?\n\n return false if end_tag_name == block_delimiter\n raise_tag_never_closed(block_name) unless end_tag_name\n\n # this tag is not registered with the system\n # pass it to the current block for special handling or error reporting\n unknown_tag(end_tag_name, end_tag_params, tokens)\n end\n ensure\n parse_context.depth -= 1\n end\n\n true\nend", + "signature": "def parse_body(body, tokens)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "api", + "text": "public", + "types": null, + "name": null + } + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "body", + null + ], + [ + "tokens", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "tag_name", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def tag_name\n @tag_name\nend", + "signature": "def tag_name", + "docstring": "Returns the value of attribute tag_name.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "line_number", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def line_number\n @line_number\nend", + "signature": "def line_number", + "docstring": "Returns the value of attribute line_number.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_context", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def parse_context\n @parse_context\nend", + "signature": "def parse_context", + "docstring": "Returns the value of attribute parse_context.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + "Liquid::Tag#options" + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "options", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 6 + ] + ], + "source": "def parse_context\n @parse_context\nend", + "signature": "def parse_context", + "docstring": "Returns the value of attribute parse_context.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 10 + ] + ], + "source": "def parse(tag_name, markup, tokenizer, parse_context)\n tag = new(tag_name, markup, parse_context)\n tag.parse(tokenizer)\n tag\nend", + "signature": "def parse(tag_name, markup, tokenizer, parse_context)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "tag_name", + null + ], + [ + "markup", + null + ], + [ + "tokenizer", + null + ], + [ + "parse_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "disable_tags", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 16 + ] + ], + "source": "def disable_tags(*tag_names)\n @disabled_tags ||= []\n @disabled_tags.concat(tag_names)\n prepend(Disabler)\nend", + "signature": "def disable_tags(*tag_names)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "*tag_names", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "raw", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 35 + ] + ], + "source": "def raw\n \"#{@tag_name} #{@markup}\"\nend", + "signature": "def raw", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "name", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 39 + ] + ], + "source": "def name\n self.class.name.downcase\nend", + "signature": "def name", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_expression", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 61 + ] + ], + "source": "def parse_expression(markup)\n parse_context.parse_expression(markup)\nend", + "signature": "def parse_expression(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "strict_parse_with_error_mode_fallback", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 5 + ] + ], + "source": "def strict_parse_with_error_mode_fallback(markup)\n strict_parse_with_error_context(markup)\nrescue SyntaxError => e\n case parse_context.error_mode\n when :strict\n raise\n when :warn\n parse_context.warnings << e\n end\n lax_parse(markup)\nend", + "signature": "def strict_parse_with_error_mode_fallback(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_with_selected_parser", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 17 + ] + ], + "source": "def parse_with_selected_parser(markup)\n case parse_context.error_mode\n when :strict then strict_parse_with_error_context(markup)\n when :lax then lax_parse(markup)\n when :warn\n begin\n strict_parse_with_error_context(markup)\n rescue SyntaxError => e\n parse_context.warnings << e\n lax_parse(markup)\n end\n end\nend", + "signature": "def parse_with_selected_parser(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "strict_parse_with_error_context", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 33 + ] + ], + "source": "def strict_parse_with_error_context(markup)\n strict_parse(markup)\nrescue SyntaxError => e\n e.line_number = line_number\n e.markup_context = markup_context(markup)\n raise e\nend", + "signature": "def strict_parse_with_error_context(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "markup_context", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 41 + ] + ], + "source": "def markup_context(markup)\n \"in \\\"#{markup.strip}\\\"\"\nend", + "signature": "def markup_context(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + } + ], + "constants": [ + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "Syntax", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Raw", + "files": [ + [ + "lib/liquid/tags/raw.rb", + 5 + ] + ], + "source": "Syntax = /\\A\\s*\\z/", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "/\\A\\s*\\z/" + }, + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "FullTokenPossiblyInvalid", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Raw", + "files": [ + [ + "lib/liquid/tags/raw.rb", + 6 + ] + ], + "source": "FullTokenPossiblyInvalid = /\\A(.*)#{TagStart}\\s*(\\w+)\\s*(.*)?#{TagEnd}\\z/om", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "/\\A(.*)#{TagStart}\\s*(\\w+)\\s*(.*)?#{TagEnd}\\z/om" + }, + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "MAX_DEPTH", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 5 + ] + ], + "source": "MAX_DEPTH = 100", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "100" + } + ], + "instance_attributes": { + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "Template", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/template.rb", + 17 + ] + ], + "source": null, + "signature": null, + "docstring": "Templates are central to liquid.\nInterpretating templates is a two step process. First you compile the\nsource code you got. During compile time some extensive error checking is performed.\nyour code should expect to get some SyntaxErrors.\n\nAfter you have a compiled template you can then render it.\nYou can use a compiled template over and over again and keep it cached.\n\nExample:\n\n template = Liquid::Template.parse(source)\n template.render('user_name' => 'bob')", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "root", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Template", + "files": [ + [ + "lib/liquid/template.rb", + 18 + ] + ], + "source": "def root\n @root\nend", + "signature": "def root", + "docstring": "Returns the value of attribute root.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "root=", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Template", + "files": [ + [ + "lib/liquid/template.rb", + 18 + ] + ], + "source": "def root=(value)\n @root = value\nend", + "signature": "def root=(value)", + "docstring": "Sets the attribute root", + "dynamic": true, + "tags": [ + { + "tag_name": "param", + "text": "the value to set the attribute root to.", + "types": null, + "name": "value" + } + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + [ + "value", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "resource_limits", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Template", + "files": [ + [ + "lib/liquid/template.rb", + 19 + ] + ], + "source": "def resource_limits\n @resource_limits\nend", + "signature": "def resource_limits", + "docstring": "Returns the value of attribute resource_limits.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "warnings", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Template", + "files": [ + [ + "lib/liquid/template.rb", + 19 + ] + ], + "source": "def warnings\n @warnings\nend", + "signature": "def warnings", + "docstring": "Returns the value of attribute warnings.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "profiler", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Template", + "files": [ + [ + "lib/liquid/template.rb", + 57 + ] + ], + "source": "def profiler\n @profiler\nend", + "signature": "def profiler", + "docstring": "Returns the value of attribute profiler.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "error_mode", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Template", + "files": [ + [ + "lib/liquid/template.rb", + 64 + ] + ], + "source": "def error_mode\n @error_mode\nend", + "signature": "def error_mode", + "docstring": "Sets how strict the parser should be.\n:lax acts like liquid 2.5 and silently ignores malformed tags in most cases.\n:warn is the default and will give deprecation warnings when invalid syntax is used.\n:strict will enforce correct syntax.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "error_mode=", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Template", + "files": [ + [ + "lib/liquid/template.rb", + 64 + ] + ], + "source": "def error_mode=(value)\n @error_mode = value\nend", + "signature": "def error_mode=(value)", + "docstring": "Sets how strict the parser should be.\n:lax acts like liquid 2.5 and silently ignores malformed tags in most cases.\n:warn is the default and will give deprecation warnings when invalid syntax is used.\n:strict will enforce correct syntax.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": null, + "parameters": [ + [ + "value", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "default_exception_renderer", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Template", + "files": [ + [ + "lib/liquid/template.rb", + 67 + ] + ], + "source": "def default_exception_renderer\n @default_exception_renderer\nend", + "signature": "def default_exception_renderer", + "docstring": "Returns the value of attribute default_exception_renderer.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "default_exception_renderer=", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Template", + "files": [ + [ + "lib/liquid/template.rb", + 67 + ] + ], + "source": "def default_exception_renderer=(value)\n @default_exception_renderer = value\nend", + "signature": "def default_exception_renderer=(value)", + "docstring": "Sets the attribute default_exception_renderer", + "dynamic": true, + "tags": [ + { + "tag_name": "param", + "text": "the value to set the attribute default_exception_renderer to.", + "types": null, + "name": "value" + } + ], + "visibility": "public", + "scope": "class", + "explicit": null, + "parameters": [ + [ + "value", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "file_system", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Template", + "files": [ + [ + "lib/liquid/template.rb", + 72 + ] + ], + "source": "def file_system\n @file_system\nend", + "signature": "def file_system", + "docstring": "Returns the value of attribute file_system.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "file_system=", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Template", + "files": [ + [ + "lib/liquid/template.rb", + 72 + ] + ], + "source": "def file_system=(value)\n @file_system = value\nend", + "signature": "def file_system=(value)", + "docstring": "Sets the attribute file_system", + "dynamic": true, + "tags": [ + { + "tag_name": "param", + "text": "the value to set the attribute file_system to.", + "types": null, + "name": "value" + } + ], + "visibility": "public", + "scope": "class", + "explicit": null, + "parameters": [ + [ + "value", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "tags", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Template", + "files": [ + [ + "lib/liquid/template.rb", + 75 + ] + ], + "source": "def tags\n @tags\nend", + "signature": "def tags", + "docstring": "Returns the value of attribute tags.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "tags=", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Template", + "files": [ + [ + "lib/liquid/template.rb", + 75 + ] + ], + "source": "def tags=(value)\n @tags = value\nend", + "signature": "def tags=(value)", + "docstring": "Sets the attribute tags", + "dynamic": true, + "tags": [ + { + "tag_name": "param", + "text": "the value to set the attribute tags to.", + "types": null, + "name": "value" + } + ], + "visibility": "public", + "scope": "class", + "explicit": null, + "parameters": [ + [ + "value", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "register_tag", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Template", + "files": [ + [ + "lib/liquid/template.rb", + 79 + ] + ], + "source": "def register_tag(name, klass)\n tags[name.to_s] = klass\nend", + "signature": "def register_tag(name, klass)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "name", + null + ], + [ + "klass", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "register_filter", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Template", + "files": [ + [ + "lib/liquid/template.rb", + 85 + ] + ], + "source": "def register_filter(mod)\n StrainerFactory.add_global_filter(mod)\nend", + "signature": "def register_filter(mod)", + "docstring": "Pass a module with filter methods which should be available\nto all liquid views. Good for registering the standard library", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "mod", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "default_resource_limits", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Template", + "files": [ + [ + "lib/liquid/template.rb", + 89 + ] + ], + "source": "def default_resource_limits\n @default_resource_limits\nend", + "signature": "def default_resource_limits", + "docstring": "Returns the value of attribute default_resource_limits.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "default_resource_limits=", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Template", + "files": [ + [ + "lib/liquid/template.rb", + 89 + ] + ], + "source": "def default_resource_limits=(value)\n @default_resource_limits = value\nend", + "signature": "def default_resource_limits=(value)", + "docstring": "Sets the attribute default_resource_limits", + "dynamic": true, + "tags": [ + { + "tag_name": "param", + "text": "the value to set the attribute default_resource_limits to.", + "types": null, + "name": "value" + } + ], + "visibility": "public", + "scope": "class", + "explicit": null, + "parameters": [ + [ + "value", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Template", + "files": [ + [ + "lib/liquid/template.rb", + 96 + ] + ], + "source": "def parse(source, options = {})\n new.parse(source, options)\nend", + "signature": "def parse(source, options = {})", + "docstring": "creates a new Template object from liquid source code\nTo enable profiling, pass in profile: true as an option.\nSee Liquid::Profiler for more information", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "source", + null + ], + [ + "options", + "{}" + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "initialize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Template", + "files": [ + [ + "lib/liquid/template.rb", + 101 + ] + ], + "source": "def initialize\n @rethrow_errors = false\n @resource_limits = ResourceLimits.new(Template.default_resource_limits)\nend", + "signature": "def initialize", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "a new instance of Template", + "types": [ + "Template" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Template", + "files": [ + [ + "lib/liquid/template.rb", + 108 + ] + ], + "source": "def parse(source, options = {})\n parse_context = configure_options(options)\n tokenizer = parse_context.new_tokenizer(source, start_line_number: @line_numbers && 1)\n @root = Document.parse(tokenizer, parse_context)\n self\nend", + "signature": "def parse(source, options = {})", + "docstring": "Parse source code.\nReturns self for easy chaining", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "source", + null + ], + [ + "options", + "{}" + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "registers", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Template", + "files": [ + [ + "lib/liquid/template.rb", + 115 + ] + ], + "source": "def registers\n @registers ||= {}\nend", + "signature": "def registers", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "assigns", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Template", + "files": [ + [ + "lib/liquid/template.rb", + 119 + ] + ], + "source": "def assigns\n @assigns ||= {}\nend", + "signature": "def assigns", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "instance_assigns", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Template", + "files": [ + [ + "lib/liquid/template.rb", + 123 + ] + ], + "source": "def instance_assigns\n @instance_assigns ||= {}\nend", + "signature": "def instance_assigns", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "errors", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Template", + "files": [ + [ + "lib/liquid/template.rb", + 127 + ] + ], + "source": "def errors\n @errors ||= []\nend", + "signature": "def errors", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "render", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Template", + "files": [ + [ + "lib/liquid/template.rb", + 145 + ] + ], + "source": "def render(*args)\n return '' if @root.nil?\n\n context = case args.first\n when Liquid::Context\n c = args.shift\n\n if @rethrow_errors\n c.exception_renderer = Liquid::RAISE_EXCEPTION_LAMBDA\n end\n\n c\n when Liquid::Drop\n drop = args.shift\n drop.context = Context.new([drop, assigns], instance_assigns, registers, @rethrow_errors, @resource_limits)\n when Hash\n Context.new([args.shift, assigns], instance_assigns, registers, @rethrow_errors, @resource_limits)\n when nil\n Context.new(assigns, instance_assigns, registers, @rethrow_errors, @resource_limits)\n else\n raise ArgumentError, \"Expected Hash or Liquid::Context as parameter\"\n end\n\n output = nil\n\n context_register = context.registers.is_a?(StaticRegisters) ? context.registers.static : context.registers\n\n case args.last\n when Hash\n options = args.pop\n output = options[:output] if options[:output]\n\n options[:registers]&.each do |key, register|\n context_register[key] = register\n end\n\n apply_options_to_context(context, options)\n when Module, Array\n context.add_filters(args.pop)\n end\n\n # Retrying a render resets resource usage\n context.resource_limits.reset\n\n if @profiling && context.profiler.nil?\n @profiler = context.profiler = Liquid::Profiler.new\n end\n\n begin\n # render the nodelist.\n @root.render_to_output_buffer(context, output || +'')\n rescue Liquid::MemoryError => e\n context.handle_error(e)\n ensure\n @errors = context.errors\n end\nend", + "signature": "def render(*args)", + "docstring": "Render takes a hash with local variables.\n\nif you use the same filters over and over again consider registering them globally\nwith Template.register_filter\n\nif profiling was enabled in Template#parse then the resulting profiling information\nwill be available via Template#profiler\n\nFollowing options can be passed:\n\n * filters : array with local filters\n * registers : hash with register variables. Those can be accessed from\n filters and tags and might be useful to integrate liquid more with its host application", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "*args", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "render!", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Template", + "files": [ + [ + "lib/liquid/template.rb", + 203 + ] + ], + "source": "def render!(*args)\n @rethrow_errors = true\n render(*args)\nend", + "signature": "def render!(*args)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "*args", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "render_to_output_buffer", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Template", + "files": [ + [ + "lib/liquid/template.rb", + 208 + ] + ], + "source": "def render_to_output_buffer(context, output)\n render(context, output: output)\nend", + "signature": "def render_to_output_buffer(context, output)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "context", + null + ], + [ + "output", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "configure_options", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Template", + "files": [ + [ + "lib/liquid/template.rb", + 214 + ] + ], + "source": "def configure_options(options)\n if (profiling = options[:profile])\n raise \"Profiler not loaded, require 'liquid/profiler' first\" unless defined?(Liquid::Profiler)\n end\n\n @options = options\n @profiling = profiling\n @line_numbers = options[:line_numbers] || @profiling\n parse_context = options.is_a?(ParseContext) ? options : ParseContext.new(options)\n @warnings = parse_context.warnings\n parse_context\nend", + "signature": "def configure_options(options)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "options", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "apply_options_to_context", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Template", + "files": [ + [ + "lib/liquid/template.rb", + 227 + ] + ], + "source": "def apply_options_to_context(context, options)\n context.add_filters(options[:filters]) if options[:filters]\n context.global_filter = options[:global_filter] if options[:global_filter]\n context.exception_renderer = options[:exception_renderer] if options[:exception_renderer]\n context.strict_variables = options[:strict_variables] if options[:strict_variables]\n context.strict_filters = options[:strict_filters] if options[:strict_filters]\nend", + "signature": "def apply_options_to_context(context, options)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "context", + null + ], + [ + "options", + null + ] + ], + "aliases": [ + + ] + } + ], + "constants": [ + + ], + "instance_attributes": { + "root": { + "read": "Liquid::Template#root", + "write": "Liquid::Template#root=" + }, + "resource_limits": { + "read": "Liquid::Template#resource_limits", + "write": null + }, + "warnings": { + "read": "Liquid::Template#warnings", + "write": null + }, + "profiler": { + "read": "Liquid::Template#profiler", + "write": null + } + }, + "class_attributes": { + "error_mode": { + "read": "Liquid::Template.error_mode", + "write": "Liquid::Template.error_mode=" + }, + "default_exception_renderer": { + "read": "Liquid::Template.default_exception_renderer", + "write": "Liquid::Template.default_exception_renderer=" + }, + "file_system": { + "read": "Liquid::Template.file_system", + "write": "Liquid::Template.file_system=" + }, + "tags": { + "read": "Liquid::Template.tags", + "write": "Liquid::Template.tags=" + }, + "default_resource_limits": { + "read": "Liquid::Template.default_resource_limits", + "write": "Liquid::Template.default_resource_limits=" + } + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "TagRegistry", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Template", + "files": [ + [ + "lib/liquid/template.rb", + 21 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "initialize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "TagRegistry", + "files": [ + [ + "lib/liquid/template.rb", + 24 + ] + ], + "source": "def initialize\n @tags = {}\n @cache = {}\nend", + "signature": "def initialize", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "a new instance of TagRegistry", + "types": [ + "TagRegistry" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "[]", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "TagRegistry", + "files": [ + [ + "lib/liquid/template.rb", + 29 + ] + ], + "source": "def [](tag_name)\n return nil unless @tags.key?(tag_name)\n return @cache[tag_name] if Liquid.cache_classes\n\n lookup_class(@tags[tag_name]).tap { |o| @cache[tag_name] = o }\nend", + "signature": "def [](tag_name)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "tag_name", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "[]=", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "TagRegistry", + "files": [ + [ + "lib/liquid/template.rb", + 36 + ] + ], + "source": "def []=(tag_name, klass)\n @tags[tag_name] = klass.name\n @cache[tag_name] = klass\nend", + "signature": "def []=(tag_name, klass)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "tag_name", + null + ], + [ + "klass", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "delete", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "TagRegistry", + "files": [ + [ + "lib/liquid/template.rb", + 41 + ] + ], + "source": "def delete(tag_name)\n @tags.delete(tag_name)\n @cache.delete(tag_name)\nend", + "signature": "def delete(tag_name)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "tag_name", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "each", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "TagRegistry", + "files": [ + [ + "lib/liquid/template.rb", + 46 + ] + ], + "source": "def each(&block)\n @tags.each(&block)\nend", + "signature": "def each(&block)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "&block", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "lookup_class", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "TagRegistry", + "files": [ + [ + "lib/liquid/template.rb", + 52 + ] + ], + "source": "def lookup_class(name)\n Object.const_get(name)\nend", + "signature": "def lookup_class(name)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "name", + null + ] + ], + "aliases": [ + + ] + } + ], + "constants": [ + + ], + "instance_attributes": { + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + null + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "Variable", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/variable.rb", + 14 + ] + ], + "source": null, + "signature": null, + "docstring": "Holds variables. Variables are only loaded \"just in time\"\nand are not evaluated as part of the render stage\n\n {{ monkey }}\n {{ user.name }}\n\nVariables can be combined with filters:\n\n {{ user | link }}", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "filters", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Variable", + "files": [ + [ + "lib/liquid/variable.rb", + 21 + ] + ], + "source": "def filters\n @filters\nend", + "signature": "def filters", + "docstring": "Returns the value of attribute filters.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "filters=", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Variable", + "files": [ + [ + "lib/liquid/variable.rb", + 21 + ] + ], + "source": "def filters=(value)\n @filters = value\nend", + "signature": "def filters=(value)", + "docstring": "Sets the attribute filters", + "dynamic": true, + "tags": [ + { + "tag_name": "param", + "text": "the value to set the attribute filters to.", + "types": null, + "name": "value" + } + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + [ + "value", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "name", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Variable", + "files": [ + [ + "lib/liquid/variable.rb", + 21 + ] + ], + "source": "def name\n @name\nend", + "signature": "def name", + "docstring": "Returns the value of attribute name.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "name=", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Variable", + "files": [ + [ + "lib/liquid/variable.rb", + 21 + ] + ], + "source": "def name=(value)\n @name = value\nend", + "signature": "def name=(value)", + "docstring": "Sets the attribute name", + "dynamic": true, + "tags": [ + { + "tag_name": "param", + "text": "the value to set the attribute name to.", + "types": null, + "name": "value" + } + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + [ + "value", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "line_number", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Variable", + "files": [ + [ + "lib/liquid/variable.rb", + 21 + ] + ], + "source": "def line_number\n @line_number\nend", + "signature": "def line_number", + "docstring": "Returns the value of attribute line_number.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "line_number=", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Variable", + "files": [ + [ + "lib/liquid/variable.rb", + 21 + ] + ], + "source": "def line_number=(value)\n @line_number = value\nend", + "signature": "def line_number=(value)", + "docstring": "Sets the attribute line_number", + "dynamic": true, + "tags": [ + { + "tag_name": "param", + "text": "the value to set the attribute line_number to.", + "types": null, + "name": "value" + } + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + [ + "value", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_context", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Variable", + "files": [ + [ + "lib/liquid/variable.rb", + 22 + ] + ], + "source": "def parse_context\n @parse_context\nend", + "signature": "def parse_context", + "docstring": "Returns the value of attribute parse_context.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + "Liquid::Variable#options" + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "options", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Variable", + "files": [ + [ + "lib/liquid/variable.rb", + 23 + ] + ], + "source": "def parse_context\n @parse_context\nend", + "signature": "def parse_context", + "docstring": "Returns the value of attribute parse_context.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "initialize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Variable", + "files": [ + [ + "lib/liquid/variable.rb", + 27 + ] + ], + "source": "def initialize(markup, parse_context)\n @markup = markup\n @name = nil\n @parse_context = parse_context\n @line_number = parse_context.line_number\n\n strict_parse_with_error_mode_fallback(markup)\nend", + "signature": "def initialize(markup, parse_context)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "a new instance of Variable", + "types": [ + "Variable" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ], + [ + "parse_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "raw", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Variable", + "files": [ + [ + "lib/liquid/variable.rb", + 36 + ] + ], + "source": "def raw\n @markup\nend", + "signature": "def raw", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "markup_context", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Variable", + "files": [ + [ + "lib/liquid/variable.rb", + 40 + ] + ], + "source": "def markup_context(markup)\n \"in \\\"{{#{markup}}}\\\"\"\nend", + "signature": "def markup_context(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "lax_parse", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Variable", + "files": [ + [ + "lib/liquid/variable.rb", + 44 + ] + ], + "source": "def lax_parse(markup)\n @filters = []\n return unless markup =~ MarkupWithQuotedFragment\n\n name_markup = Regexp.last_match(1)\n filter_markup = Regexp.last_match(2)\n @name = Expression.parse(name_markup)\n if filter_markup =~ FilterMarkupRegex\n filters = Regexp.last_match(1).scan(FilterParser)\n filters.each do |f|\n next unless f =~ /\\w+/\n filtername = Regexp.last_match(0)\n filterargs = f.scan(FilterArgsRegex).flatten\n @filters << parse_filter_expressions(filtername, filterargs)\n end\n end\nend", + "signature": "def lax_parse(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "strict_parse", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Variable", + "files": [ + [ + "lib/liquid/variable.rb", + 62 + ] + ], + "source": "def strict_parse(markup)\n @filters = []\n p = Parser.new(markup)\n\n return if p.look(:end_of_string)\n\n @name = Expression.parse(p.expression)\n while p.consume?(:pipe)\n filtername = p.consume(:id)\n filterargs = p.consume?(:colon) ? parse_filterargs(p) : []\n @filters << parse_filter_expressions(filtername, filterargs)\n end\n p.consume(:end_of_string)\nend", + "signature": "def strict_parse(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_filterargs", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Variable", + "files": [ + [ + "lib/liquid/variable.rb", + 77 + ] + ], + "source": "def parse_filterargs(p)\n # first argument\n filterargs = [p.argument]\n # followed by comma separated others\n filterargs << p.argument while p.consume?(:comma)\n filterargs\nend", + "signature": "def parse_filterargs(p)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "p", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "render", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Variable", + "files": [ + [ + "lib/liquid/variable.rb", + 85 + ] + ], + "source": "def render(context)\n obj = context.evaluate(@name)\n\n @filters.each do |filter_name, filter_args, filter_kwargs|\n filter_args = evaluate_filter_expressions(context, filter_args, filter_kwargs)\n obj = context.invoke(filter_name, obj, *filter_args)\n end\n\n context.apply_global_filter(obj)\nend", + "signature": "def render(context)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "render_to_output_buffer", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Variable", + "files": [ + [ + "lib/liquid/variable.rb", + 96 + ] + ], + "source": "def render_to_output_buffer(context, output)\n obj = render(context)\n\n if obj.is_a?(Array)\n output << obj.join\n elsif obj.nil?\n else\n output << obj.to_s\n end\n\n output\nend", + "signature": "def render_to_output_buffer(context, output)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "context", + null + ], + [ + "output", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "disabled?", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Variable", + "files": [ + [ + "lib/liquid/variable.rb", + 109 + ] + ], + "source": "def disabled?(_context)\n false\nend", + "signature": "def disabled?(_context)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "", + "types": [ + "Boolean" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "disabled_tags", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Variable", + "files": [ + [ + "lib/liquid/variable.rb", + 113 + ] + ], + "source": "def disabled_tags\n []\nend", + "signature": "def disabled_tags", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_filter_expressions", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Variable", + "files": [ + [ + "lib/liquid/variable.rb", + 119 + ] + ], + "source": "def parse_filter_expressions(filter_name, unparsed_args)\n filter_args = []\n keyword_args = nil\n unparsed_args.each do |a|\n if (matches = a.match(JustTagAttributes))\n keyword_args ||= {}\n keyword_args[matches[1]] = Expression.parse(matches[2])\n else\n filter_args << Expression.parse(a)\n end\n end\n result = [filter_name, filter_args]\n result << keyword_args if keyword_args\n result\nend", + "signature": "def parse_filter_expressions(filter_name, unparsed_args)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "filter_name", + null + ], + [ + "unparsed_args", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "evaluate_filter_expressions", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Variable", + "files": [ + [ + "lib/liquid/variable.rb", + 135 + ] + ], + "source": "def evaluate_filter_expressions(context, filter_args, filter_kwargs)\n parsed_args = filter_args.map { |expr| context.evaluate(expr) }\n if filter_kwargs\n parsed_kwargs = {}\n filter_kwargs.each do |key, expr|\n parsed_kwargs[key] = context.evaluate(expr)\n end\n parsed_args << parsed_kwargs\n end\n parsed_args\nend", + "signature": "def evaluate_filter_expressions(context, filter_args, filter_kwargs)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "context", + null + ], + [ + "filter_args", + null + ], + [ + "filter_kwargs", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "strict_parse_with_error_mode_fallback", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 5 + ] + ], + "source": "def strict_parse_with_error_mode_fallback(markup)\n strict_parse_with_error_context(markup)\nrescue SyntaxError => e\n case parse_context.error_mode\n when :strict\n raise\n when :warn\n parse_context.warnings << e\n end\n lax_parse(markup)\nend", + "signature": "def strict_parse_with_error_mode_fallback(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_with_selected_parser", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 17 + ] + ], + "source": "def parse_with_selected_parser(markup)\n case parse_context.error_mode\n when :strict then strict_parse_with_error_context(markup)\n when :lax then lax_parse(markup)\n when :warn\n begin\n strict_parse_with_error_context(markup)\n rescue SyntaxError => e\n parse_context.warnings << e\n lax_parse(markup)\n end\n end\nend", + "signature": "def parse_with_selected_parser(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "strict_parse_with_error_context", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 33 + ] + ], + "source": "def strict_parse_with_error_context(markup)\n strict_parse(markup)\nrescue SyntaxError => e\n e.line_number = line_number\n e.markup_context = markup_context(markup)\n raise e\nend", + "signature": "def strict_parse_with_error_context(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + } + ], + "constants": [ + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "FilterMarkupRegex", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Variable", + "files": [ + [ + "lib/liquid/variable.rb", + 15 + ] + ], + "source": "FilterMarkupRegex = /#{FilterSeparator}\\s*(.*)/om", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "/#{FilterSeparator}\\s*(.*)/om" + }, + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "FilterParser", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Variable", + "files": [ + [ + "lib/liquid/variable.rb", + 16 + ] + ], + "source": "FilterParser = /(?:\\s+|#{QuotedFragment}|#{ArgumentSeparator})+/o", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "/(?:\\s+|#{QuotedFragment}|#{ArgumentSeparator})+/o" + }, + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "FilterArgsRegex", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Variable", + "files": [ + [ + "lib/liquid/variable.rb", + 17 + ] + ], + "source": "FilterArgsRegex = /(?:#{FilterArgumentSeparator}|#{ArgumentSeparator})\\s*((?:\\w+\\s*\\:\\s*)?#{QuotedFragment})/o", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "/(?:#{FilterArgumentSeparator}|#{ArgumentSeparator})\\s*((?:\\w+\\s*\\:\\s*)?#{QuotedFragment})/o" + }, + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "JustTagAttributes", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Variable", + "files": [ + [ + "lib/liquid/variable.rb", + 18 + ] + ], + "source": "JustTagAttributes = /\\A#{TagAttributes}\\z/o", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "/\\A#{TagAttributes}\\z/o" + }, + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "MarkupWithQuotedFragment", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Variable", + "files": [ + [ + "lib/liquid/variable.rb", + 19 + ] + ], + "source": "MarkupWithQuotedFragment = /(#{QuotedFragment})(.*)/om", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "/(#{QuotedFragment})(.*)/om" + } + ], + "instance_attributes": { + "filters": { + "read": "Liquid::Variable#filters", + "write": "Liquid::Variable#filters=" + }, + "name": { + "read": "Liquid::Variable#name", + "write": "Liquid::Variable#name=" + }, + "line_number": { + "read": "Liquid::Variable#line_number", + "write": "Liquid::Variable#line_number=" + }, + "parse_context": { + "read": "Liquid::Variable#parse_context", + "write": null + } + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + { + "type": "YARD::CodeObjects::ModuleObject", + "name": "ParserSwitching", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 4 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ] + } + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "ParseTreeVisitor", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Variable", + "files": [ + [ + "lib/liquid/variable.rb", + 147 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "children", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/variable.rb", + 148 + ] + ], + "source": "def children\n [@node.name] + @node.filters.flatten\nend", + "signature": "def children", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "for", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/parse_tree_visitor.rb", + 5 + ] + ], + "source": "def self.for(node, callbacks = Hash.new(proc {}))\n if defined?(node.class::ParseTreeVisitor)\n node.class::ParseTreeVisitor\n else\n self\n end.new(node, callbacks)\nend", + "signature": "def for(node, callbacks = Hash.new(proc {}))", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "node", + null + ], + [ + "callbacks", + "Hash.new(proc {})" + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "initialize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/parse_tree_visitor.rb", + 13 + ] + ], + "source": "def initialize(node, callbacks)\n @node = node\n @callbacks = callbacks\nend", + "signature": "def initialize(node, callbacks)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "a new instance of ParseTreeVisitor", + "types": [ + "ParseTreeVisitor" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "node", + null + ], + [ + "callbacks", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "add_callback_for", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/parse_tree_visitor.rb", + 18 + ] + ], + "source": "def add_callback_for(*classes, &block)\n callback = block\n callback = ->(node, _) { yield node } if block.arity.abs == 1\n callback = ->(_, _) { yield } if block.arity.zero?\n classes.each { |klass| @callbacks[klass] = callback }\n self\nend", + "signature": "def add_callback_for(*classes, &block)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "*classes", + null + ], + [ + "&block", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "visit", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/parse_tree_visitor.rb", + 26 + ] + ], + "source": "def visit(context = nil)\n children.map do |node|\n item, new_context = @callbacks[node.class].call(node, context)\n [\n item,\n ParseTreeVisitor.for(node, @callbacks).visit(new_context || context),\n ]\n end\nend", + "signature": "def visit(context = nil)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "context", + "nil" + ] + ], + "aliases": [ + + ] + } + ], + "constants": [ + + ], + "instance_attributes": { + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "Condition", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/condition.rb", + 11 + ] + ], + "source": null, + "signature": null, + "docstring": "Container for liquid nodes which conveniently wraps decision making logic\n\nExample:\n\n c = Condition.new(1, '==', 1)\n c.evaluate #=> true", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + { + "type": "YARD::CodeObjects::ClassVariableObject", + "name": "@@operators", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Condition", + "files": [ + [ + "lib/liquid/condition.rb", + 12 + ] + ], + "source": "@@operators = {\n '==' => ->(cond, left, right) { cond.send(:equal_variables, left, right) },\n '!=' => ->(cond, left, right) { !cond.send(:equal_variables, left, right) },\n '<>' => ->(cond, left, right) { !cond.send(:equal_variables, left, right) },\n '<' => :<,\n '>' => :>,\n '>=' => :>=,\n '<=' => :<=,\n 'contains' => lambda do |_cond, left, right|\n if left && right && left.respond_to?(:include?)\n right = right.to_s if left.is_a?(String)\n left.include?(right)\n else\n false\n end\n end,\n}", + "signature": null, + "docstring": ":nodoc:", + "dynamic": true, + "tags": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassVariableObject", + "name": "@@method_literals", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Condition", + "files": [ + [ + "lib/liquid/condition.rb", + 39 + ] + ], + "source": "@@method_literals = {\n 'blank' => MethodLiteral.new(:blank?, '').freeze,\n 'empty' => MethodLiteral.new(:empty?, '').freeze,\n}", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ] + } + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "operators", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Condition", + "files": [ + [ + "lib/liquid/condition.rb", + 44 + ] + ], + "source": "def self.operators\n @@operators\nend", + "signature": "def operators", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_expression", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Condition", + "files": [ + [ + "lib/liquid/condition.rb", + 48 + ] + ], + "source": "def self.parse_expression(parse_context, markup)\n @@method_literals[markup] || parse_context.parse_expression(markup)\nend", + "signature": "def parse_expression(parse_context, markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "parse_context", + null + ], + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "attachment", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Condition", + "files": [ + [ + "lib/liquid/condition.rb", + 52 + ] + ], + "source": "def attachment\n @attachment\nend", + "signature": "def attachment", + "docstring": "Returns the value of attribute attachment.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "child_condition", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Condition", + "files": [ + [ + "lib/liquid/condition.rb", + 52 + ] + ], + "source": "def child_condition\n @child_condition\nend", + "signature": "def child_condition", + "docstring": "Returns the value of attribute child_condition.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "left", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Condition", + "files": [ + [ + "lib/liquid/condition.rb", + 53 + ] + ], + "source": "def left\n @left\nend", + "signature": "def left", + "docstring": "Returns the value of attribute left.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "left=", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Condition", + "files": [ + [ + "lib/liquid/condition.rb", + 53 + ] + ], + "source": "def left=(value)\n @left = value\nend", + "signature": "def left=(value)", + "docstring": "Sets the attribute left", + "dynamic": true, + "tags": [ + { + "tag_name": "param", + "text": "the value to set the attribute left to.", + "types": null, + "name": "value" + } + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + [ + "value", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "operator", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Condition", + "files": [ + [ + "lib/liquid/condition.rb", + 53 + ] + ], + "source": "def operator\n @operator\nend", + "signature": "def operator", + "docstring": "Returns the value of attribute operator.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "operator=", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Condition", + "files": [ + [ + "lib/liquid/condition.rb", + 53 + ] + ], + "source": "def operator=(value)\n @operator = value\nend", + "signature": "def operator=(value)", + "docstring": "Sets the attribute operator", + "dynamic": true, + "tags": [ + { + "tag_name": "param", + "text": "the value to set the attribute operator to.", + "types": null, + "name": "value" + } + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + [ + "value", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "right", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Condition", + "files": [ + [ + "lib/liquid/condition.rb", + 53 + ] + ], + "source": "def right\n @right\nend", + "signature": "def right", + "docstring": "Returns the value of attribute right.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "right=", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Condition", + "files": [ + [ + "lib/liquid/condition.rb", + 53 + ] + ], + "source": "def right=(value)\n @right = value\nend", + "signature": "def right=(value)", + "docstring": "Sets the attribute right", + "dynamic": true, + "tags": [ + { + "tag_name": "param", + "text": "the value to set the attribute right to.", + "types": null, + "name": "value" + } + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + [ + "value", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "initialize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Condition", + "files": [ + [ + "lib/liquid/condition.rb", + 55 + ] + ], + "source": "def initialize(left = nil, operator = nil, right = nil)\n @left = left\n @operator = operator\n @right = right\n\n @child_relation = nil\n @child_condition = nil\nend", + "signature": "def initialize(left = nil, operator = nil, right = nil)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "a new instance of Condition", + "types": [ + "Condition" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "left", + "nil" + ], + [ + "operator", + "nil" + ], + [ + "right", + "nil" + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "evaluate", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Condition", + "files": [ + [ + "lib/liquid/condition.rb", + 64 + ] + ], + "source": "def evaluate(context = Context.new)\n condition = self\n result = nil\n loop do\n result = interpret_condition(condition.left, condition.right, condition.operator, context)\n\n case condition.child_relation\n when :or\n break if result\n when :and\n break unless result\n else\n break\n end\n condition = condition.child_condition\n end\n result\nend", + "signature": "def evaluate(context = Context.new)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "context", + "Context.new" + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "or", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Condition", + "files": [ + [ + "lib/liquid/condition.rb", + 83 + ] + ], + "source": "def or(condition)\n @child_relation = :or\n @child_condition = condition\nend", + "signature": "def or(condition)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "condition", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "and", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Condition", + "files": [ + [ + "lib/liquid/condition.rb", + 88 + ] + ], + "source": "def and(condition)\n @child_relation = :and\n @child_condition = condition\nend", + "signature": "def and(condition)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "condition", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "attach", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Condition", + "files": [ + [ + "lib/liquid/condition.rb", + 93 + ] + ], + "source": "def attach(attachment)\n @attachment = attachment\nend", + "signature": "def attach(attachment)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "attachment", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "else?", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Condition", + "files": [ + [ + "lib/liquid/condition.rb", + 97 + ] + ], + "source": "def else?\n false\nend", + "signature": "def else?", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "", + "types": [ + "Boolean" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "inspect", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Condition", + "files": [ + [ + "lib/liquid/condition.rb", + 101 + ] + ], + "source": "def inspect\n \"#\"\nend", + "signature": "def inspect", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "child_relation", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Condition", + "files": [ + [ + "lib/liquid/condition.rb", + 107 + ] + ], + "source": "def child_relation\n @child_relation\nend", + "signature": "def child_relation", + "docstring": "Returns the value of attribute child_relation.", + "dynamic": true, + "tags": [ + + ], + "visibility": "protected", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "equal_variables", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Condition", + "files": [ + [ + "lib/liquid/condition.rb", + 111 + ] + ], + "source": "def equal_variables(left, right)\n if left.is_a?(MethodLiteral)\n if right.respond_to?(left.method_name)\n return right.send(left.method_name)\n else\n return nil\n end\n end\n\n if right.is_a?(MethodLiteral)\n if left.respond_to?(right.method_name)\n return left.send(right.method_name)\n else\n return nil\n end\n end\n\n left == right\nend", + "signature": "def equal_variables(left, right)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "left", + null + ], + [ + "right", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "interpret_condition", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Condition", + "files": [ + [ + "lib/liquid/condition.rb", + 131 + ] + ], + "source": "def interpret_condition(left, right, op, context)\n # If the operator is empty this means that the decision statement is just\n # a single variable. We can just poll this variable from the context and\n # return this as the result.\n return context.evaluate(left) if op.nil?\n\n left = Liquid::Utils.to_liquid_value(context.evaluate(left))\n right = Liquid::Utils.to_liquid_value(context.evaluate(right))\n\n operation = self.class.operators[op] || raise(Liquid::ArgumentError, \"Unknown operator #{op}\")\n\n if operation.respond_to?(:call)\n operation.call(self, left, right)\n elsif left.respond_to?(operation) && right.respond_to?(operation) && !left.is_a?(Hash) && !right.is_a?(Hash)\n begin\n left.send(operation, right)\n rescue ::ArgumentError => e\n raise Liquid::ArgumentError, e.message\n end\n end\nend", + "signature": "def interpret_condition(left, right, op, context)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "left", + null + ], + [ + "right", + null + ], + [ + "op", + null + ], + [ + "context", + null + ] + ], + "aliases": [ + + ] + } + ], + "constants": [ + + ], + "instance_attributes": { + "attachment": { + "read": "Liquid::Condition#attachment", + "write": null + }, + "child_condition": { + "read": "Liquid::Condition#child_condition", + "write": null + }, + "left": { + "read": "Liquid::Condition#left", + "write": "Liquid::Condition#left=" + }, + "operator": { + "read": "Liquid::Condition#operator", + "write": "Liquid::Condition#operator=" + }, + "right": { + "read": "Liquid::Condition#right", + "write": "Liquid::Condition#right=" + }, + "child_relation": { + "read": "Liquid::Condition#child_relation", + "write": null + } + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "MethodLiteral", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Condition", + "files": [ + [ + "lib/liquid/condition.rb", + 30 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "method_name", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "MethodLiteral", + "files": [ + [ + "lib/liquid/condition.rb", + 31 + ] + ], + "source": "def method_name\n @method_name\nend", + "signature": "def method_name", + "docstring": "Returns the value of attribute method_name.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "to_s", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "MethodLiteral", + "files": [ + [ + "lib/liquid/condition.rb", + 31 + ] + ], + "source": "def to_s\n @to_s\nend", + "signature": "def to_s", + "docstring": "Returns the value of attribute to_s.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "initialize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "MethodLiteral", + "files": [ + [ + "lib/liquid/condition.rb", + 33 + ] + ], + "source": "def initialize(method_name, to_s)\n @method_name = method_name\n @to_s = to_s\nend", + "signature": "def initialize(method_name, to_s)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "a new instance of MethodLiteral", + "types": [ + "MethodLiteral" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "method_name", + null + ], + [ + "to_s", + null + ] + ], + "aliases": [ + + ] + } + ], + "constants": [ + + ], + "instance_attributes": { + "method_name": { + "read": "Liquid::Condition::MethodLiteral#method_name", + "write": null + }, + "to_s": { + "read": "Liquid::Condition::MethodLiteral#to_s", + "write": null + } + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "ParseTreeVisitor", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Condition", + "files": [ + [ + "lib/liquid/condition.rb", + 153 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "children", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/condition.rb", + 154 + ] + ], + "source": "def children\n [\n @node.left, @node.right,\n @node.child_condition, @node.attachment\n ].compact\nend", + "signature": "def children", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "for", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/parse_tree_visitor.rb", + 5 + ] + ], + "source": "def self.for(node, callbacks = Hash.new(proc {}))\n if defined?(node.class::ParseTreeVisitor)\n node.class::ParseTreeVisitor\n else\n self\n end.new(node, callbacks)\nend", + "signature": "def for(node, callbacks = Hash.new(proc {}))", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "node", + null + ], + [ + "callbacks", + "Hash.new(proc {})" + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "initialize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/parse_tree_visitor.rb", + 13 + ] + ], + "source": "def initialize(node, callbacks)\n @node = node\n @callbacks = callbacks\nend", + "signature": "def initialize(node, callbacks)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "a new instance of ParseTreeVisitor", + "types": [ + "ParseTreeVisitor" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "node", + null + ], + [ + "callbacks", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "add_callback_for", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/parse_tree_visitor.rb", + 18 + ] + ], + "source": "def add_callback_for(*classes, &block)\n callback = block\n callback = ->(node, _) { yield node } if block.arity.abs == 1\n callback = ->(_, _) { yield } if block.arity.zero?\n classes.each { |klass| @callbacks[klass] = callback }\n self\nend", + "signature": "def add_callback_for(*classes, &block)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "*classes", + null + ], + [ + "&block", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "visit", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/parse_tree_visitor.rb", + 26 + ] + ], + "source": "def visit(context = nil)\n children.map do |node|\n item, new_context = @callbacks[node.class].call(node, context)\n [\n item,\n ParseTreeVisitor.for(node, @callbacks).visit(new_context || context),\n ]\n end\nend", + "signature": "def visit(context = nil)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "context", + "nil" + ] + ], + "aliases": [ + + ] + } + ], + "constants": [ + + ], + "instance_attributes": { + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "ElseCondition", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/condition.rb", + 163 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "else?", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ElseCondition", + "files": [ + [ + "lib/liquid/condition.rb", + 164 + ] + ], + "source": "def else?\n true\nend", + "signature": "def else?", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "", + "types": [ + "Boolean" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "evaluate", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ElseCondition", + "files": [ + [ + "lib/liquid/condition.rb", + 168 + ] + ], + "source": "def evaluate(_context)\n true\nend", + "signature": "def evaluate(_context)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "operators", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Condition", + "files": [ + [ + "lib/liquid/condition.rb", + 44 + ] + ], + "source": "def self.operators\n @@operators\nend", + "signature": "def operators", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_expression", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Condition", + "files": [ + [ + "lib/liquid/condition.rb", + 48 + ] + ], + "source": "def self.parse_expression(parse_context, markup)\n @@method_literals[markup] || parse_context.parse_expression(markup)\nend", + "signature": "def parse_expression(parse_context, markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "parse_context", + null + ], + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "attachment", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Condition", + "files": [ + [ + "lib/liquid/condition.rb", + 52 + ] + ], + "source": "def attachment\n @attachment\nend", + "signature": "def attachment", + "docstring": "Returns the value of attribute attachment.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "child_condition", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Condition", + "files": [ + [ + "lib/liquid/condition.rb", + 52 + ] + ], + "source": "def child_condition\n @child_condition\nend", + "signature": "def child_condition", + "docstring": "Returns the value of attribute child_condition.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "left", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Condition", + "files": [ + [ + "lib/liquid/condition.rb", + 53 + ] + ], + "source": "def left\n @left\nend", + "signature": "def left", + "docstring": "Returns the value of attribute left.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "left=", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Condition", + "files": [ + [ + "lib/liquid/condition.rb", + 53 + ] + ], + "source": "def left=(value)\n @left = value\nend", + "signature": "def left=(value)", + "docstring": "Sets the attribute left", + "dynamic": true, + "tags": [ + { + "tag_name": "param", + "text": "the value to set the attribute left to.", + "types": null, + "name": "value" + } + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + [ + "value", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "operator", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Condition", + "files": [ + [ + "lib/liquid/condition.rb", + 53 + ] + ], + "source": "def operator\n @operator\nend", + "signature": "def operator", + "docstring": "Returns the value of attribute operator.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "operator=", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Condition", + "files": [ + [ + "lib/liquid/condition.rb", + 53 + ] + ], + "source": "def operator=(value)\n @operator = value\nend", + "signature": "def operator=(value)", + "docstring": "Sets the attribute operator", + "dynamic": true, + "tags": [ + { + "tag_name": "param", + "text": "the value to set the attribute operator to.", + "types": null, + "name": "value" + } + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + [ + "value", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "right", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Condition", + "files": [ + [ + "lib/liquid/condition.rb", + 53 + ] + ], + "source": "def right\n @right\nend", + "signature": "def right", + "docstring": "Returns the value of attribute right.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "right=", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Condition", + "files": [ + [ + "lib/liquid/condition.rb", + 53 + ] + ], + "source": "def right=(value)\n @right = value\nend", + "signature": "def right=(value)", + "docstring": "Sets the attribute right", + "dynamic": true, + "tags": [ + { + "tag_name": "param", + "text": "the value to set the attribute right to.", + "types": null, + "name": "value" + } + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + [ + "value", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "initialize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Condition", + "files": [ + [ + "lib/liquid/condition.rb", + 55 + ] + ], + "source": "def initialize(left = nil, operator = nil, right = nil)\n @left = left\n @operator = operator\n @right = right\n\n @child_relation = nil\n @child_condition = nil\nend", + "signature": "def initialize(left = nil, operator = nil, right = nil)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "a new instance of Condition", + "types": [ + "Condition" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "left", + "nil" + ], + [ + "operator", + "nil" + ], + [ + "right", + "nil" + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "or", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Condition", + "files": [ + [ + "lib/liquid/condition.rb", + 83 + ] + ], + "source": "def or(condition)\n @child_relation = :or\n @child_condition = condition\nend", + "signature": "def or(condition)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "condition", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "and", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Condition", + "files": [ + [ + "lib/liquid/condition.rb", + 88 + ] + ], + "source": "def and(condition)\n @child_relation = :and\n @child_condition = condition\nend", + "signature": "def and(condition)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "condition", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "attach", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Condition", + "files": [ + [ + "lib/liquid/condition.rb", + 93 + ] + ], + "source": "def attach(attachment)\n @attachment = attachment\nend", + "signature": "def attach(attachment)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "attachment", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "inspect", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Condition", + "files": [ + [ + "lib/liquid/condition.rb", + 101 + ] + ], + "source": "def inspect\n \"#\"\nend", + "signature": "def inspect", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "child_relation", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Condition", + "files": [ + [ + "lib/liquid/condition.rb", + 107 + ] + ], + "source": "def child_relation\n @child_relation\nend", + "signature": "def child_relation", + "docstring": "Returns the value of attribute child_relation.", + "dynamic": true, + "tags": [ + + ], + "visibility": "protected", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "equal_variables", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Condition", + "files": [ + [ + "lib/liquid/condition.rb", + 111 + ] + ], + "source": "def equal_variables(left, right)\n if left.is_a?(MethodLiteral)\n if right.respond_to?(left.method_name)\n return right.send(left.method_name)\n else\n return nil\n end\n end\n\n if right.is_a?(MethodLiteral)\n if left.respond_to?(right.method_name)\n return left.send(right.method_name)\n else\n return nil\n end\n end\n\n left == right\nend", + "signature": "def equal_variables(left, right)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "left", + null + ], + [ + "right", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "interpret_condition", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Condition", + "files": [ + [ + "lib/liquid/condition.rb", + 131 + ] + ], + "source": "def interpret_condition(left, right, op, context)\n # If the operator is empty this means that the decision statement is just\n # a single variable. We can just poll this variable from the context and\n # return this as the result.\n return context.evaluate(left) if op.nil?\n\n left = Liquid::Utils.to_liquid_value(context.evaluate(left))\n right = Liquid::Utils.to_liquid_value(context.evaluate(right))\n\n operation = self.class.operators[op] || raise(Liquid::ArgumentError, \"Unknown operator #{op}\")\n\n if operation.respond_to?(:call)\n operation.call(self, left, right)\n elsif left.respond_to?(operation) && right.respond_to?(operation) && !left.is_a?(Hash) && !right.is_a?(Hash)\n begin\n left.send(operation, right)\n rescue ::ArgumentError => e\n raise Liquid::ArgumentError, e.message\n end\n end\nend", + "signature": "def interpret_condition(left, right, op, context)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "left", + null + ], + [ + "right", + null + ], + [ + "op", + null + ], + [ + "context", + null + ] + ], + "aliases": [ + + ] + } + ], + "constants": [ + + ], + "instance_attributes": { + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "Case", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/tags/case.rb", + 4 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "blocks", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Case", + "files": [ + [ + "lib/liquid/tags/case.rb", + 8 + ] + ], + "source": "def blocks\n @blocks\nend", + "signature": "def blocks", + "docstring": "Returns the value of attribute blocks.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "left", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Case", + "files": [ + [ + "lib/liquid/tags/case.rb", + 8 + ] + ], + "source": "def left\n @left\nend", + "signature": "def left", + "docstring": "Returns the value of attribute left.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "initialize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Case", + "files": [ + [ + "lib/liquid/tags/case.rb", + 10 + ] + ], + "source": "def initialize(tag_name, markup, options)\n super\n @blocks = []\n\n if markup =~ Syntax\n @left = parse_expression(Regexp.last_match(1))\n else\n raise SyntaxError, options[:locale].t(\"errors.syntax.case\")\n end\nend", + "signature": "def initialize(tag_name, markup, options)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "a new instance of Case", + "types": [ + "Case" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "tag_name", + null + ], + [ + "markup", + null + ], + [ + "options", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Case", + "files": [ + [ + "lib/liquid/tags/case.rb", + 21 + ] + ], + "source": "def parse(tokens)\n body = case_body = new_body\n body = @blocks.last.attachment while parse_body(body, tokens)\n @blocks.reverse_each do |condition|\n body = condition.attachment\n unless body.frozen?\n body.remove_blank_strings if blank?\n body.freeze\n end\n end\n case_body.freeze\nend", + "signature": "def parse(tokens)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "tokens", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "nodelist", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Case", + "files": [ + [ + "lib/liquid/tags/case.rb", + 34 + ] + ], + "source": "def nodelist\n @blocks.map(&:attachment)\nend", + "signature": "def nodelist", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "unknown_tag", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Case", + "files": [ + [ + "lib/liquid/tags/case.rb", + 38 + ] + ], + "source": "def unknown_tag(tag, markup, tokens)\n case tag\n when 'when'\n record_when_condition(markup)\n when 'else'\n record_else_condition(markup)\n else\n super\n end\nend", + "signature": "def unknown_tag(tag, markup, tokens)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "tag", + null + ], + [ + "markup", + null + ], + [ + "tokens", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "render_to_output_buffer", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Case", + "files": [ + [ + "lib/liquid/tags/case.rb", + 49 + ] + ], + "source": "def render_to_output_buffer(context, output)\n execute_else_block = true\n\n @blocks.each do |block|\n if block.else?\n block.attachment.render_to_output_buffer(context, output) if execute_else_block\n next\n end\n\n result = Liquid::Utils.to_liquid_value(\n block.evaluate(context)\n )\n\n if result\n execute_else_block = false\n block.attachment.render_to_output_buffer(context, output)\n end\n end\n\n output\nend", + "signature": "def render_to_output_buffer(context, output)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "context", + null + ], + [ + "output", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "record_when_condition", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Case", + "files": [ + [ + "lib/liquid/tags/case.rb", + 73 + ] + ], + "source": "def record_when_condition(markup)\n body = new_body\n\n while markup\n unless markup =~ WhenSyntax\n raise SyntaxError, options[:locale].t(\"errors.syntax.case_invalid_when\")\n end\n\n markup = Regexp.last_match(2)\n\n block = Condition.new(@left, '==', Condition.parse_expression(parse_context, Regexp.last_match(1)))\n block.attach(body)\n @blocks << block\n end\nend", + "signature": "def record_when_condition(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "record_else_condition", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Case", + "files": [ + [ + "lib/liquid/tags/case.rb", + 89 + ] + ], + "source": "def record_else_condition(markup)\n unless markup.strip.empty?\n raise SyntaxError, options[:locale].t(\"errors.syntax.case_invalid_else\")\n end\n\n block = ElseCondition.new\n block.attach(new_body)\n @blocks << block\nend", + "signature": "def record_else_condition(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "render", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 20 + ] + ], + "source": "def render(context)\n @body.render(context)\nend", + "signature": "def render(context)", + "docstring": "For backwards compatibility", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "blank?", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 24 + ] + ], + "source": "def blank?\n @blank\nend", + "signature": "def blank?", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "", + "types": [ + "Boolean" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "raise_unknown_tag", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 37 + ] + ], + "source": "def self.raise_unknown_tag(tag, block_name, block_delimiter, parse_context)\n if tag == 'else'\n raise SyntaxError, parse_context.locale.t(\"errors.syntax.unexpected_else\",\n block_name: block_name)\n elsif tag.start_with?('end')\n raise SyntaxError, parse_context.locale.t(\"errors.syntax.invalid_delimiter\",\n tag: tag,\n block_name: block_name,\n block_delimiter: block_delimiter)\n else\n raise SyntaxError, parse_context.locale.t(\"errors.syntax.unknown_tag\", tag: tag)\n end\nend", + "signature": "def raise_unknown_tag(tag, block_name, block_delimiter, parse_context)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "api", + "text": "private", + "types": null, + "name": null + } + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "tag", + null + ], + [ + "block_name", + null + ], + [ + "block_delimiter", + null + ], + [ + "parse_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "raise_tag_never_closed", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 51 + ] + ], + "source": "def raise_tag_never_closed(block_name)\n raise SyntaxError, parse_context.locale.t(\"errors.syntax.tag_never_closed\", block_name: block_name)\nend", + "signature": "def raise_tag_never_closed(block_name)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "raise", + "text": "", + "types": [ + "SyntaxError" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "block_name", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "block_name", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 55 + ] + ], + "source": "def block_name\n @tag_name\nend", + "signature": "def block_name", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "block_delimiter", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 59 + ] + ], + "source": "def block_delimiter\n @block_delimiter ||= \"end#{block_name}\"\nend", + "signature": "def block_delimiter", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "new_body", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 66 + ] + ], + "source": "def new_body\n parse_context.new_block_body\nend", + "signature": "def new_body", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "api", + "text": "public", + "types": null, + "name": null + } + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_body", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 71 + ] + ], + "source": "def parse_body(body, tokens)\n if parse_context.depth >= MAX_DEPTH\n raise StackLevelError, \"Nesting too deep\"\n end\n parse_context.depth += 1\n begin\n body.parse(tokens, parse_context) do |end_tag_name, end_tag_params|\n @blank &&= body.blank?\n\n return false if end_tag_name == block_delimiter\n raise_tag_never_closed(block_name) unless end_tag_name\n\n # this tag is not registered with the system\n # pass it to the current block for special handling or error reporting\n unknown_tag(end_tag_name, end_tag_params, tokens)\n end\n ensure\n parse_context.depth -= 1\n end\n\n true\nend", + "signature": "def parse_body(body, tokens)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "api", + "text": "public", + "types": null, + "name": null + } + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "body", + null + ], + [ + "tokens", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "tag_name", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def tag_name\n @tag_name\nend", + "signature": "def tag_name", + "docstring": "Returns the value of attribute tag_name.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "line_number", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def line_number\n @line_number\nend", + "signature": "def line_number", + "docstring": "Returns the value of attribute line_number.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_context", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def parse_context\n @parse_context\nend", + "signature": "def parse_context", + "docstring": "Returns the value of attribute parse_context.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + "Liquid::Tag#options" + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "options", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 6 + ] + ], + "source": "def parse_context\n @parse_context\nend", + "signature": "def parse_context", + "docstring": "Returns the value of attribute parse_context.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 10 + ] + ], + "source": "def parse(tag_name, markup, tokenizer, parse_context)\n tag = new(tag_name, markup, parse_context)\n tag.parse(tokenizer)\n tag\nend", + "signature": "def parse(tag_name, markup, tokenizer, parse_context)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "tag_name", + null + ], + [ + "markup", + null + ], + [ + "tokenizer", + null + ], + [ + "parse_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "disable_tags", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 16 + ] + ], + "source": "def disable_tags(*tag_names)\n @disabled_tags ||= []\n @disabled_tags.concat(tag_names)\n prepend(Disabler)\nend", + "signature": "def disable_tags(*tag_names)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "*tag_names", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "raw", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 35 + ] + ], + "source": "def raw\n \"#{@tag_name} #{@markup}\"\nend", + "signature": "def raw", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "name", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 39 + ] + ], + "source": "def name\n self.class.name.downcase\nend", + "signature": "def name", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_expression", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 61 + ] + ], + "source": "def parse_expression(markup)\n parse_context.parse_expression(markup)\nend", + "signature": "def parse_expression(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "strict_parse_with_error_mode_fallback", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 5 + ] + ], + "source": "def strict_parse_with_error_mode_fallback(markup)\n strict_parse_with_error_context(markup)\nrescue SyntaxError => e\n case parse_context.error_mode\n when :strict\n raise\n when :warn\n parse_context.warnings << e\n end\n lax_parse(markup)\nend", + "signature": "def strict_parse_with_error_mode_fallback(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_with_selected_parser", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 17 + ] + ], + "source": "def parse_with_selected_parser(markup)\n case parse_context.error_mode\n when :strict then strict_parse_with_error_context(markup)\n when :lax then lax_parse(markup)\n when :warn\n begin\n strict_parse_with_error_context(markup)\n rescue SyntaxError => e\n parse_context.warnings << e\n lax_parse(markup)\n end\n end\nend", + "signature": "def parse_with_selected_parser(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "strict_parse_with_error_context", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 33 + ] + ], + "source": "def strict_parse_with_error_context(markup)\n strict_parse(markup)\nrescue SyntaxError => e\n e.line_number = line_number\n e.markup_context = markup_context(markup)\n raise e\nend", + "signature": "def strict_parse_with_error_context(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "markup_context", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 41 + ] + ], + "source": "def markup_context(markup)\n \"in \\\"#{markup.strip}\\\"\"\nend", + "signature": "def markup_context(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + } + ], + "constants": [ + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "Syntax", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Case", + "files": [ + [ + "lib/liquid/tags/case.rb", + 5 + ] + ], + "source": "Syntax = /(#{QuotedFragment})/o", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "/(#{QuotedFragment})/o" + }, + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "WhenSyntax", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Case", + "files": [ + [ + "lib/liquid/tags/case.rb", + 6 + ] + ], + "source": "WhenSyntax = /(#{QuotedFragment})(?:(?:\\s+or\\s+|\\s*\\,\\s*)(#{QuotedFragment}.*))?/om", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "/(#{QuotedFragment})(?:(?:\\s+or\\s+|\\s*\\,\\s*)(#{QuotedFragment}.*))?/om" + }, + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "MAX_DEPTH", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 5 + ] + ], + "source": "MAX_DEPTH = 100", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "100" + } + ], + "instance_attributes": { + "blocks": { + "read": "Liquid::Case#blocks", + "write": null + }, + "left": { + "read": "Liquid::Case#left", + "write": null + } + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "ParseTreeVisitor", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Case", + "files": [ + [ + "lib/liquid/tags/case.rb", + 99 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "children", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/tags/case.rb", + 100 + ] + ], + "source": "def children\n [@node.left] + @node.blocks\nend", + "signature": "def children", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "for", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/parse_tree_visitor.rb", + 5 + ] + ], + "source": "def self.for(node, callbacks = Hash.new(proc {}))\n if defined?(node.class::ParseTreeVisitor)\n node.class::ParseTreeVisitor\n else\n self\n end.new(node, callbacks)\nend", + "signature": "def for(node, callbacks = Hash.new(proc {}))", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "node", + null + ], + [ + "callbacks", + "Hash.new(proc {})" + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "initialize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/parse_tree_visitor.rb", + 13 + ] + ], + "source": "def initialize(node, callbacks)\n @node = node\n @callbacks = callbacks\nend", + "signature": "def initialize(node, callbacks)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "a new instance of ParseTreeVisitor", + "types": [ + "ParseTreeVisitor" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "node", + null + ], + [ + "callbacks", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "add_callback_for", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/parse_tree_visitor.rb", + 18 + ] + ], + "source": "def add_callback_for(*classes, &block)\n callback = block\n callback = ->(node, _) { yield node } if block.arity.abs == 1\n callback = ->(_, _) { yield } if block.arity.zero?\n classes.each { |klass| @callbacks[klass] = callback }\n self\nend", + "signature": "def add_callback_for(*classes, &block)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "*classes", + null + ], + [ + "&block", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "visit", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/parse_tree_visitor.rb", + 26 + ] + ], + "source": "def visit(context = nil)\n children.map do |node|\n item, new_context = @callbacks[node.class].call(node, context)\n [\n item,\n ParseTreeVisitor.for(node, @callbacks).visit(new_context || context),\n ]\n end\nend", + "signature": "def visit(context = nil)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "context", + "nil" + ] + ], + "aliases": [ + + ] + } + ], + "constants": [ + + ], + "instance_attributes": { + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "Echo", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/tags/echo.rb", + 14 + ] + ], + "source": null, + "signature": null, + "docstring": "Echo outputs an expression\n\n {% echo monkey %}\n {% echo user.name %}\n\nThis is identical to variable output syntax, like {{ foo }}, but works\ninside {% liquid %} tags. The full syntax is supported, including filters:\n\n {% echo user | link %}", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "variable", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Echo", + "files": [ + [ + "lib/liquid/tags/echo.rb", + 15 + ] + ], + "source": "def variable\n @variable\nend", + "signature": "def variable", + "docstring": "Returns the value of attribute variable.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "initialize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Echo", + "files": [ + [ + "lib/liquid/tags/echo.rb", + 17 + ] + ], + "source": "def initialize(tag_name, markup, parse_context)\n super\n @variable = Variable.new(markup, parse_context)\nend", + "signature": "def initialize(tag_name, markup, parse_context)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "a new instance of Echo", + "types": [ + "Echo" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "tag_name", + null + ], + [ + "markup", + null + ], + [ + "parse_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "render", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Echo", + "files": [ + [ + "lib/liquid/tags/echo.rb", + 22 + ] + ], + "source": "def render(context)\n @variable.render_to_output_buffer(context, +'')\nend", + "signature": "def render(context)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "nodelist", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def nodelist\n @nodelist\nend", + "signature": "def nodelist", + "docstring": "Returns the value of attribute nodelist.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "tag_name", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def tag_name\n @tag_name\nend", + "signature": "def tag_name", + "docstring": "Returns the value of attribute tag_name.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "line_number", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def line_number\n @line_number\nend", + "signature": "def line_number", + "docstring": "Returns the value of attribute line_number.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_context", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def parse_context\n @parse_context\nend", + "signature": "def parse_context", + "docstring": "Returns the value of attribute parse_context.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + "Liquid::Tag#options" + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "options", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 6 + ] + ], + "source": "def parse_context\n @parse_context\nend", + "signature": "def parse_context", + "docstring": "Returns the value of attribute parse_context.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 10 + ] + ], + "source": "def parse(tag_name, markup, tokenizer, parse_context)\n tag = new(tag_name, markup, parse_context)\n tag.parse(tokenizer)\n tag\nend", + "signature": "def parse(tag_name, markup, tokenizer, parse_context)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "tag_name", + null + ], + [ + "markup", + null + ], + [ + "tokenizer", + null + ], + [ + "parse_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "disable_tags", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 16 + ] + ], + "source": "def disable_tags(*tag_names)\n @disabled_tags ||= []\n @disabled_tags.concat(tag_names)\n prepend(Disabler)\nend", + "signature": "def disable_tags(*tag_names)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "*tag_names", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 32 + ] + ], + "source": "def parse(_tokens)\nend", + "signature": "def parse(_tokens)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "_tokens", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "raw", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 35 + ] + ], + "source": "def raw\n \"#{@tag_name} #{@markup}\"\nend", + "signature": "def raw", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "name", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 39 + ] + ], + "source": "def name\n self.class.name.downcase\nend", + "signature": "def name", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "render_to_output_buffer", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 50 + ] + ], + "source": "def render_to_output_buffer(context, output)\n output << render(context)\n output\nend", + "signature": "def render_to_output_buffer(context, output)", + "docstring": "For backwards compatibility with custom tags. In a future release, the semantics\nof the `render_to_output_buffer` method will become the default and the `render`\nmethod will be removed.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "context", + null + ], + [ + "output", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "blank?", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 55 + ] + ], + "source": "def blank?\n false\nend", + "signature": "def blank?", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "", + "types": [ + "Boolean" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_expression", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 61 + ] + ], + "source": "def parse_expression(markup)\n parse_context.parse_expression(markup)\nend", + "signature": "def parse_expression(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "strict_parse_with_error_mode_fallback", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 5 + ] + ], + "source": "def strict_parse_with_error_mode_fallback(markup)\n strict_parse_with_error_context(markup)\nrescue SyntaxError => e\n case parse_context.error_mode\n when :strict\n raise\n when :warn\n parse_context.warnings << e\n end\n lax_parse(markup)\nend", + "signature": "def strict_parse_with_error_mode_fallback(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_with_selected_parser", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 17 + ] + ], + "source": "def parse_with_selected_parser(markup)\n case parse_context.error_mode\n when :strict then strict_parse_with_error_context(markup)\n when :lax then lax_parse(markup)\n when :warn\n begin\n strict_parse_with_error_context(markup)\n rescue SyntaxError => e\n parse_context.warnings << e\n lax_parse(markup)\n end\n end\nend", + "signature": "def parse_with_selected_parser(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "strict_parse_with_error_context", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 33 + ] + ], + "source": "def strict_parse_with_error_context(markup)\n strict_parse(markup)\nrescue SyntaxError => e\n e.line_number = line_number\n e.markup_context = markup_context(markup)\n raise e\nend", + "signature": "def strict_parse_with_error_context(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "markup_context", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 41 + ] + ], + "source": "def markup_context(markup)\n \"in \\\"#{markup.strip}\\\"\"\nend", + "signature": "def markup_context(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + } + ], + "constants": [ + + ], + "instance_attributes": { + "variable": { + "read": "Liquid::Echo#variable", + "write": null + } + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "ParseTreeVisitor", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Echo", + "files": [ + [ + "lib/liquid/tags/echo.rb", + 26 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "children", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/tags/echo.rb", + 27 + ] + ], + "source": "def children\n [@node.variable]\nend", + "signature": "def children", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "for", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/parse_tree_visitor.rb", + 5 + ] + ], + "source": "def self.for(node, callbacks = Hash.new(proc {}))\n if defined?(node.class::ParseTreeVisitor)\n node.class::ParseTreeVisitor\n else\n self\n end.new(node, callbacks)\nend", + "signature": "def for(node, callbacks = Hash.new(proc {}))", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "node", + null + ], + [ + "callbacks", + "Hash.new(proc {})" + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "initialize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/parse_tree_visitor.rb", + 13 + ] + ], + "source": "def initialize(node, callbacks)\n @node = node\n @callbacks = callbacks\nend", + "signature": "def initialize(node, callbacks)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "a new instance of ParseTreeVisitor", + "types": [ + "ParseTreeVisitor" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "node", + null + ], + [ + "callbacks", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "add_callback_for", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/parse_tree_visitor.rb", + 18 + ] + ], + "source": "def add_callback_for(*classes, &block)\n callback = block\n callback = ->(node, _) { yield node } if block.arity.abs == 1\n callback = ->(_, _) { yield } if block.arity.zero?\n classes.each { |klass| @callbacks[klass] = callback }\n self\nend", + "signature": "def add_callback_for(*classes, &block)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "*classes", + null + ], + [ + "&block", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "visit", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/parse_tree_visitor.rb", + 26 + ] + ], + "source": "def visit(context = nil)\n children.map do |node|\n item, new_context = @callbacks[node.class].call(node, context)\n [\n item,\n ParseTreeVisitor.for(node, @callbacks).visit(new_context || context),\n ]\n end\nend", + "signature": "def visit(context = nil)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "context", + "nil" + ] + ], + "aliases": [ + + ] + } + ], + "constants": [ + + ], + "instance_attributes": { + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "Tokenizer", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/tokenizer.rb", + 4 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "line_number", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tokenizer", + "files": [ + [ + "lib/liquid/tokenizer.rb", + 5 + ] + ], + "source": "def line_number\n @line_number\nend", + "signature": "def line_number", + "docstring": "Returns the value of attribute line_number.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "for_liquid_tag", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tokenizer", + "files": [ + [ + "lib/liquid/tokenizer.rb", + 5 + ] + ], + "source": "def for_liquid_tag\n @for_liquid_tag\nend", + "signature": "def for_liquid_tag", + "docstring": "Returns the value of attribute for_liquid_tag.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "initialize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tokenizer", + "files": [ + [ + "lib/liquid/tokenizer.rb", + 7 + ] + ], + "source": "def initialize(source, line_numbers = false, line_number: nil, for_liquid_tag: false)\n @source = source.to_s.to_str\n @line_number = line_number || (line_numbers ? 1 : nil)\n @for_liquid_tag = for_liquid_tag\n @tokens = tokenize\nend", + "signature": "def initialize(source, line_numbers = false, line_number: nil, for_liquid_tag: false)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "a new instance of Tokenizer", + "types": [ + "Tokenizer" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "source", + null + ], + [ + "line_numbers", + "false" + ], + [ + "line_number:", + "nil" + ], + [ + "for_liquid_tag:", + "false" + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "shift", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tokenizer", + "files": [ + [ + "lib/liquid/tokenizer.rb", + 14 + ] + ], + "source": "def shift\n (token = @tokens.shift) || return\n\n if @line_number\n @line_number += @for_liquid_tag ? 1 : token.count(\"\\n\")\n end\n\n token\nend", + "signature": "def shift", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "tokenize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tokenizer", + "files": [ + [ + "lib/liquid/tokenizer.rb", + 26 + ] + ], + "source": "def tokenize\n return [] if @source.empty?\n\n return @source.split(\"\\n\") if @for_liquid_tag\n\n tokens = @source.split(TemplateParser)\n\n # removes the rogue empty element at the beginning of the array\n tokens.shift if tokens[0]&.empty?\n\n tokens\nend", + "signature": "def tokenize", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + } + ], + "constants": [ + + ], + "instance_attributes": { + "line_number": { + "read": "Liquid::Tokenizer#line_number", + "write": null + }, + "for_liquid_tag": { + "read": "Liquid::Tokenizer#for_liquid_tag", + "write": null + } + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "BlockBody", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/block_body.rb", + 6 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "nodelist", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "BlockBody", + "files": [ + [ + "lib/liquid/block_body.rb", + 14 + ] + ], + "source": "def nodelist\n @nodelist\nend", + "signature": "def nodelist", + "docstring": "Returns the value of attribute nodelist.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "initialize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "BlockBody", + "files": [ + [ + "lib/liquid/block_body.rb", + 16 + ] + ], + "source": "def initialize\n @nodelist = []\n @blank = true\nend", + "signature": "def initialize", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "a new instance of BlockBody", + "types": [ + "BlockBody" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "BlockBody", + "files": [ + [ + "lib/liquid/block_body.rb", + 21 + ] + ], + "source": "def parse(tokenizer, parse_context, &block)\n raise FrozenError, \"can't modify frozen Liquid::BlockBody\" if frozen?\n\n parse_context.line_number = tokenizer.line_number\n\n if tokenizer.for_liquid_tag\n parse_for_liquid_tag(tokenizer, parse_context, &block)\n else\n parse_for_document(tokenizer, parse_context, &block)\n end\nend", + "signature": "def parse(tokenizer, parse_context, &block)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "raise", + "text": "", + "types": [ + "FrozenError" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "tokenizer", + null + ], + [ + "parse_context", + null + ], + [ + "&block", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "freeze", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "BlockBody", + "files": [ + [ + "lib/liquid/block_body.rb", + 33 + ] + ], + "source": "def freeze\n @nodelist.freeze\n super\nend", + "signature": "def freeze", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_for_liquid_tag", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "BlockBody", + "files": [ + [ + "lib/liquid/block_body.rb", + 38 + ] + ], + "source": "private def parse_for_liquid_tag(tokenizer, parse_context)\n while (token = tokenizer.shift)\n unless token.empty? || token =~ WhitespaceOrNothing\n unless token =~ LiquidTagToken\n # line isn't empty but didn't match tag syntax, yield and let the\n # caller raise a syntax error\n return yield token, token\n end\n tag_name = Regexp.last_match(1)\n markup = Regexp.last_match(2)\n unless (tag = registered_tags[tag_name])\n # end parsing if we reach an unknown tag and let the caller decide\n # determine how to proceed\n return yield tag_name, markup\n end\n new_tag = tag.parse(tag_name, markup, tokenizer, parse_context)\n @blank &&= new_tag.blank?\n @nodelist << new_tag\n end\n parse_context.line_number = tokenizer.line_number\n end\n\n yield nil, nil\nend", + "signature": "def parse_for_liquid_tag(tokenizer, parse_context)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "yield", + "text": "", + "types": [ + "nil", + "nil" + ], + "name": null + } + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "tokenizer", + null + ], + [ + "parse_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "unknown_tag_in_liquid_tag", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "BlockBody", + "files": [ + [ + "lib/liquid/block_body.rb", + 64 + ] + ], + "source": "def self.unknown_tag_in_liquid_tag(tag, parse_context)\n Block.raise_unknown_tag(tag, 'liquid', '%}', parse_context)\nend", + "signature": "def unknown_tag_in_liquid_tag(tag, parse_context)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "api", + "text": "private", + "types": null, + "name": null + } + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "tag", + null + ], + [ + "parse_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "raise_missing_tag_terminator", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "BlockBody", + "files": [ + [ + "lib/liquid/block_body.rb", + 69 + ] + ], + "source": "def self.raise_missing_tag_terminator(token, parse_context)\n raise SyntaxError, parse_context.locale.t(\"errors.syntax.tag_termination\", token: token, tag_end: TagEnd.inspect)\nend", + "signature": "def raise_missing_tag_terminator(token, parse_context)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "api", + "text": "private", + "types": null, + "name": null + }, + { + "tag_name": "raise", + "text": "", + "types": [ + "SyntaxError" + ], + "name": null + } + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "token", + null + ], + [ + "parse_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "raise_missing_variable_terminator", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "BlockBody", + "files": [ + [ + "lib/liquid/block_body.rb", + 74 + ] + ], + "source": "def self.raise_missing_variable_terminator(token, parse_context)\n raise SyntaxError, parse_context.locale.t(\"errors.syntax.variable_termination\", token: token, tag_end: VariableEnd.inspect)\nend", + "signature": "def raise_missing_variable_terminator(token, parse_context)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "api", + "text": "private", + "types": null, + "name": null + }, + { + "tag_name": "raise", + "text": "", + "types": [ + "SyntaxError" + ], + "name": null + } + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "token", + null + ], + [ + "parse_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "render_node", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "BlockBody", + "files": [ + [ + "lib/liquid/block_body.rb", + 79 + ] + ], + "source": "def self.render_node(context, output, node)\n node.render_to_output_buffer(context, output)\nrescue => exc\n blank_tag = !node.instance_of?(Variable) && node.blank?\n rescue_render_node(context, output, node.line_number, exc, blank_tag)\nend", + "signature": "def render_node(context, output, node)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "api", + "text": "private", + "types": null, + "name": null + } + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "context", + null + ], + [ + "output", + null + ], + [ + "node", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "rescue_render_node", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "BlockBody", + "files": [ + [ + "lib/liquid/block_body.rb", + 87 + ] + ], + "source": "def self.rescue_render_node(context, output, line_number, exc, blank_tag)\n case exc\n when MemoryError\n raise\n when UndefinedVariable, UndefinedDropMethod, UndefinedFilter\n context.handle_error(exc, line_number)\n else\n error_message = context.handle_error(exc, line_number)\n unless blank_tag # conditional for backwards compatibility\n output << error_message\n end\n end\nend", + "signature": "def rescue_render_node(context, output, line_number, exc, blank_tag)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "api", + "text": "private", + "types": null, + "name": null + } + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "context", + null + ], + [ + "output", + null + ], + [ + "line_number", + null + ], + [ + "exc", + null + ], + [ + "blank_tag", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_liquid_tag", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "BlockBody", + "files": [ + [ + "lib/liquid/block_body.rb", + 101 + ] + ], + "source": "private def parse_liquid_tag(markup, parse_context)\n liquid_tag_tokenizer = parse_context.new_tokenizer(\n markup, start_line_number: parse_context.line_number, for_liquid_tag: true\n )\n parse_for_liquid_tag(liquid_tag_tokenizer, parse_context) do |end_tag_name, _end_tag_markup|\n if end_tag_name\n BlockBody.unknown_tag_in_liquid_tag(end_tag_name, parse_context)\n end\n end\nend", + "signature": "def parse_liquid_tag(markup, parse_context)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ], + [ + "parse_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_for_document", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "BlockBody", + "files": [ + [ + "lib/liquid/block_body.rb", + 112 + ] + ], + "source": "private def parse_for_document(tokenizer, parse_context)\n while (token = tokenizer.shift)\n next if token.empty?\n case\n when token.start_with?(TAGSTART)\n whitespace_handler(token, parse_context)\n unless token =~ FullToken\n BlockBody.raise_missing_tag_terminator(token, parse_context)\n end\n tag_name = Regexp.last_match(2)\n markup = Regexp.last_match(4)\n\n if parse_context.line_number\n # newlines inside the tag should increase the line number,\n # particularly important for multiline {% liquid %} tags\n parse_context.line_number += Regexp.last_match(1).count(\"\\n\") + Regexp.last_match(3).count(\"\\n\")\n end\n\n if tag_name == 'liquid'\n parse_liquid_tag(markup, parse_context)\n next\n end\n\n unless (tag = registered_tags[tag_name])\n # end parsing if we reach an unknown tag and let the caller decide\n # determine how to proceed\n return yield tag_name, markup\n end\n new_tag = tag.parse(tag_name, markup, tokenizer, parse_context)\n @blank &&= new_tag.blank?\n @nodelist << new_tag\n when token.start_with?(VARSTART)\n whitespace_handler(token, parse_context)\n @nodelist << create_variable(token, parse_context)\n @blank = false\n else\n if parse_context.trim_whitespace\n token.lstrip!\n end\n parse_context.trim_whitespace = false\n @nodelist << token\n @blank &&= !!(token =~ WhitespaceOrNothing)\n end\n parse_context.line_number = tokenizer.line_number\n end\n\n yield nil, nil\nend", + "signature": "def parse_for_document(tokenizer, parse_context)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "yield", + "text": "", + "types": [ + "nil", + "nil" + ], + "name": null + } + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "tokenizer", + null + ], + [ + "parse_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "whitespace_handler", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "BlockBody", + "files": [ + [ + "lib/liquid/block_body.rb", + 161 + ] + ], + "source": "def whitespace_handler(token, parse_context)\n if token[2] == WhitespaceControl\n previous_token = @nodelist.last\n if previous_token.is_a?(String)\n first_byte = previous_token.getbyte(0)\n previous_token.rstrip!\n if previous_token.empty? && parse_context[:bug_compatible_whitespace_trimming] && first_byte\n previous_token << first_byte\n end\n end\n end\n parse_context.trim_whitespace = (token[-3] == WhitespaceControl)\nend", + "signature": "def whitespace_handler(token, parse_context)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "token", + null + ], + [ + "parse_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "blank?", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "BlockBody", + "files": [ + [ + "lib/liquid/block_body.rb", + 175 + ] + ], + "source": "def blank?\n @blank\nend", + "signature": "def blank?", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "", + "types": [ + "Boolean" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "remove_blank_strings", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "BlockBody", + "files": [ + [ + "lib/liquid/block_body.rb", + 194 + ] + ], + "source": "def remove_blank_strings\n raise \"remove_blank_strings only support being called on a blank block body\" unless @blank\n @nodelist.reject! { |node| node.instance_of?(String) }\nend", + "signature": "def remove_blank_strings", + "docstring": "Remove blank strings in the block body for a control flow tag (e.g. `if`, `for`, `case`, `unless`)\nwith a blank body.\n\nFor example, in a conditional assignment like the following\n\n```\n{% if size > max_size %}\n {% assign size = max_size %}\n{% endif %}\n```\n\nwe assume the intention wasn't to output the blank spaces in the `if` tag's block body, so this method\nwill remove them to reduce the render output size.\n\nNote that it is now preferred to use the `liquid` tag for this use case.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "render", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "BlockBody", + "files": [ + [ + "lib/liquid/block_body.rb", + 199 + ] + ], + "source": "def render(context)\n render_to_output_buffer(context, +'')\nend", + "signature": "def render(context)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "render_to_output_buffer", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "BlockBody", + "files": [ + [ + "lib/liquid/block_body.rb", + 203 + ] + ], + "source": "def render_to_output_buffer(context, output)\n freeze unless frozen?\n\n context.resource_limits.increment_render_score(@nodelist.length)\n\n idx = 0\n while (node = @nodelist[idx])\n if node.instance_of?(String)\n output << node\n else\n render_node(context, output, node)\n # If we get an Interrupt that means the block must stop processing. An\n # Interrupt is any command that stops block execution such as {% break %}\n # or {% continue %}. These tags may also occur through Block or Include tags.\n break if context.interrupt? # might have happened in a for-block\n end\n idx += 1\n\n context.resource_limits.increment_write_score(output)\n end\n\n output\nend", + "signature": "def render_to_output_buffer(context, output)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "context", + null + ], + [ + "output", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "render_node", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "BlockBody", + "files": [ + [ + "lib/liquid/block_body.rb", + 229 + ] + ], + "source": "def render_node(context, output, node)\n BlockBody.render_node(context, output, node)\nend", + "signature": "def render_node(context, output, node)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "context", + null + ], + [ + "output", + null + ], + [ + "node", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "create_variable", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "BlockBody", + "files": [ + [ + "lib/liquid/block_body.rb", + 233 + ] + ], + "source": "def create_variable(token, parse_context)\n token.scan(ContentOfVariable) do |content|\n markup = content.first\n return Variable.new(markup, parse_context)\n end\n BlockBody.raise_missing_variable_terminator(token, parse_context)\nend", + "signature": "def create_variable(token, parse_context)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "token", + null + ], + [ + "parse_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "raise_missing_tag_terminator", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "BlockBody", + "files": [ + [ + "lib/liquid/block_body.rb", + 242 + ] + ], + "source": "def raise_missing_tag_terminator(token, parse_context)\n BlockBody.raise_missing_tag_terminator(token, parse_context)\nend", + "signature": "def raise_missing_tag_terminator(token, parse_context)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "deprecated", + "text": "Use {.raise_missing_tag_terminator} instead", + "types": null, + "name": null + } + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "token", + null + ], + [ + "parse_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "raise_missing_variable_terminator", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "BlockBody", + "files": [ + [ + "lib/liquid/block_body.rb", + 247 + ] + ], + "source": "def raise_missing_variable_terminator(token, parse_context)\n BlockBody.raise_missing_variable_terminator(token, parse_context)\nend", + "signature": "def raise_missing_variable_terminator(token, parse_context)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "deprecated", + "text": "Use {.raise_missing_variable_terminator} instead", + "types": null, + "name": null + } + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "token", + null + ], + [ + "parse_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "registered_tags", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "BlockBody", + "files": [ + [ + "lib/liquid/block_body.rb", + 251 + ] + ], + "source": "def registered_tags\n Template.tags\nend", + "signature": "def registered_tags", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + } + ], + "constants": [ + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "LiquidTagToken", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "BlockBody", + "files": [ + [ + "lib/liquid/block_body.rb", + 7 + ] + ], + "source": "LiquidTagToken = /\\A\\s*(\\w+)\\s*(.*?)\\z/o", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "/\\A\\s*(\\w+)\\s*(.*?)\\z/o" + }, + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "FullToken", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "BlockBody", + "files": [ + [ + "lib/liquid/block_body.rb", + 8 + ] + ], + "source": "FullToken = /\\A#{TagStart}#{WhitespaceControl}?(\\s*)(\\w+)(\\s*)(.*?)#{WhitespaceControl}?#{TagEnd}\\z/om", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "/\\A#{TagStart}#{WhitespaceControl}?(\\s*)(\\w+)(\\s*)(.*?)#{WhitespaceControl}?#{TagEnd}\\z/om" + }, + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "ContentOfVariable", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "BlockBody", + "files": [ + [ + "lib/liquid/block_body.rb", + 9 + ] + ], + "source": "ContentOfVariable = /\\A#{VariableStart}#{WhitespaceControl}?(.*?)#{WhitespaceControl}?#{VariableEnd}\\z/om", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "/\\A#{VariableStart}#{WhitespaceControl}?(.*?)#{WhitespaceControl}?#{VariableEnd}\\z/om" + }, + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "WhitespaceOrNothing", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "BlockBody", + "files": [ + [ + "lib/liquid/block_body.rb", + 10 + ] + ], + "source": "WhitespaceOrNothing = /\\A\\s*\\z/", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "/\\A\\s*\\z/" + }, + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "TAGSTART", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "BlockBody", + "files": [ + [ + "lib/liquid/block_body.rb", + 11 + ] + ], + "source": "TAGSTART = \"{%\"", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "\"{%\"" + }, + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "VARSTART", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "BlockBody", + "files": [ + [ + "lib/liquid/block_body.rb", + 12 + ] + ], + "source": "VARSTART = \"{{\"", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "\"{{\"" + } + ], + "instance_attributes": { + "nodelist": { + "read": "Liquid::BlockBody#nodelist", + "write": null + } + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + { + "type": "YARD::CodeObjects::ModuleObject", + "name": "BlockBodyProfilingHook", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/profiler/hooks.rb", + 4 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ] + } + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "Expression", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/expression.rb", + 4 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Expression", + "files": [ + [ + "lib/liquid/expression.rb", + 22 + ] + ], + "source": "def self.parse(markup)\n case markup\n when nil\n nil\n when SINGLE_QUOTED_STRING, DOUBLE_QUOTED_STRING\n Regexp.last_match(1)\n when INTEGERS_REGEX\n Regexp.last_match(1).to_i\n when RANGES_REGEX\n RangeLookup.parse(Regexp.last_match(1), Regexp.last_match(2))\n when FLOATS_REGEX\n Regexp.last_match(1).to_f\n else\n markup = markup.strip\n if LITERALS.key?(markup)\n LITERALS[markup]\n else\n VariableLookup.parse(markup)\n end\n end\nend", + "signature": "def parse(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + } + ], + "constants": [ + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "LITERALS", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Expression", + "files": [ + [ + "lib/liquid/expression.rb", + 5 + ] + ], + "source": "LITERALS = {\n nil => nil, 'nil' => nil, 'null' => nil, '' => nil,\n 'true' => true,\n 'false' => false,\n 'blank' => '',\n 'empty' => ''\n}.freeze", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "{\n nil => nil, 'nil' => nil, 'null' => nil, '' => nil,\n 'true' => true,\n 'false' => false,\n 'blank' => '',\n 'empty' => ''\n}.freeze" + }, + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "SINGLE_QUOTED_STRING", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Expression", + "files": [ + [ + "lib/liquid/expression.rb", + 13 + ] + ], + "source": "SINGLE_QUOTED_STRING = /\\A\\s*'(.*)'\\s*\\z/m", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "/\\A\\s*'(.*)'\\s*\\z/m" + }, + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "DOUBLE_QUOTED_STRING", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Expression", + "files": [ + [ + "lib/liquid/expression.rb", + 14 + ] + ], + "source": "DOUBLE_QUOTED_STRING = /\\A\\s*\"(.*)\"\\s*\\z/m", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "/\\A\\s*\"(.*)\"\\s*\\z/m" + }, + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "INTEGERS_REGEX", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Expression", + "files": [ + [ + "lib/liquid/expression.rb", + 15 + ] + ], + "source": "INTEGERS_REGEX = /\\A\\s*(-?\\d+)\\s*\\z/", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "/\\A\\s*(-?\\d+)\\s*\\z/" + }, + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "FLOATS_REGEX", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Expression", + "files": [ + [ + "lib/liquid/expression.rb", + 16 + ] + ], + "source": "FLOATS_REGEX = /\\A\\s*(-?\\d[\\d\\.]+)\\s*\\z/", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "/\\A\\s*(-?\\d[\\d\\.]+)\\s*\\z/" + }, + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "RANGES_REGEX", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Expression", + "files": [ + [ + "lib/liquid/expression.rb", + 20 + ] + ], + "source": "RANGES_REGEX = /\\A\\s*\\(\\s*(?>(\\S+)\\s*\\.\\.)\\s*(\\S+)\\s*\\)\\s*\\z/", + "signature": null, + "docstring": "Use an atomic group (?>...) to avoid pathological backtracing from\nmalicious input as described in https://github.com/Shopify/liquid/issues/1357", + "dynamic": true, + "tags": [ + + ], + "value": "/\\A\\s*\\(\\s*(?>(\\S+)\\s*\\.\\.)\\s*(\\S+)\\s*\\)\\s*\\z/" + } + ], + "instance_attributes": { + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "String", + "namespace_type": "YARD::CodeObjects::RootObject", + "namespace_name": "root", + "files": [ + [ + "lib/liquid/extensions.rb", + 6 + ] + ], + "source": null, + "signature": null, + "docstring": ":nodoc:", + "dynamic": null, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "to_liquid", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "String", + "files": [ + [ + "lib/liquid/extensions.rb", + 7 + ] + ], + "source": "def to_liquid\n self\nend", + "signature": "def to_liquid", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + } + ], + "constants": [ + + ], + "instance_attributes": { + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "Symbol", + "namespace_type": "YARD::CodeObjects::RootObject", + "namespace_name": "root", + "files": [ + [ + "lib/liquid/extensions.rb", + 12 + ] + ], + "source": null, + "signature": null, + "docstring": ":nodoc:", + "dynamic": null, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "to_liquid", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Symbol", + "files": [ + [ + "lib/liquid/extensions.rb", + 13 + ] + ], + "source": "def to_liquid\n to_s\nend", + "signature": "def to_liquid", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + } + ], + "constants": [ + + ], + "instance_attributes": { + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "Array", + "namespace_type": "YARD::CodeObjects::RootObject", + "namespace_name": "root", + "files": [ + [ + "lib/liquid/extensions.rb", + 18 + ] + ], + "source": null, + "signature": null, + "docstring": ":nodoc:", + "dynamic": null, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "to_liquid", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Array", + "files": [ + [ + "lib/liquid/extensions.rb", + 19 + ] + ], + "source": "def to_liquid\n self\nend", + "signature": "def to_liquid", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + } + ], + "constants": [ + + ], + "instance_attributes": { + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "Hash", + "namespace_type": "YARD::CodeObjects::RootObject", + "namespace_name": "root", + "files": [ + [ + "lib/liquid/extensions.rb", + 24 + ] + ], + "source": null, + "signature": null, + "docstring": ":nodoc:", + "dynamic": null, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "to_liquid", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Hash", + "files": [ + [ + "lib/liquid/extensions.rb", + 25 + ] + ], + "source": "def to_liquid\n self\nend", + "signature": "def to_liquid", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + } + ], + "constants": [ + + ], + "instance_attributes": { + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "Numeric", + "namespace_type": "YARD::CodeObjects::RootObject", + "namespace_name": "root", + "files": [ + [ + "lib/liquid/extensions.rb", + 30 + ] + ], + "source": null, + "signature": null, + "docstring": ":nodoc:", + "dynamic": null, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "to_liquid", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Numeric", + "files": [ + [ + "lib/liquid/extensions.rb", + 31 + ] + ], + "source": "def to_liquid\n self\nend", + "signature": "def to_liquid", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + } + ], + "constants": [ + + ], + "instance_attributes": { + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "Range", + "namespace_type": "YARD::CodeObjects::RootObject", + "namespace_name": "root", + "files": [ + [ + "lib/liquid/extensions.rb", + 36 + ] + ], + "source": null, + "signature": null, + "docstring": ":nodoc:", + "dynamic": null, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "to_liquid", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Range", + "files": [ + [ + "lib/liquid/extensions.rb", + 37 + ] + ], + "source": "def to_liquid\n self\nend", + "signature": "def to_liquid", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + } + ], + "constants": [ + + ], + "instance_attributes": { + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "Time", + "namespace_type": "YARD::CodeObjects::RootObject", + "namespace_name": "root", + "files": [ + [ + "lib/liquid/extensions.rb", + 42 + ] + ], + "source": null, + "signature": null, + "docstring": ":nodoc:", + "dynamic": null, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "to_liquid", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Time", + "files": [ + [ + "lib/liquid/extensions.rb", + 43 + ] + ], + "source": "def to_liquid\n self\nend", + "signature": "def to_liquid", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + } + ], + "constants": [ + + ], + "instance_attributes": { + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "DateTime", + "namespace_type": "YARD::CodeObjects::RootObject", + "namespace_name": "root", + "files": [ + [ + "lib/liquid/extensions.rb", + 48 + ] + ], + "source": null, + "signature": null, + "docstring": ":nodoc:", + "dynamic": null, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "to_liquid", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "DateTime", + "files": [ + [ + "lib/liquid/extensions.rb", + 49 + ] + ], + "source": "def to_liquid\n self\nend", + "signature": "def to_liquid", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + } + ], + "constants": [ + + ], + "instance_attributes": { + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "Date", + "namespace_type": "YARD::CodeObjects::RootObject", + "namespace_name": "root", + "files": [ + [ + "lib/liquid/extensions.rb", + 54 + ] + ], + "source": null, + "signature": null, + "docstring": ":nodoc:", + "dynamic": null, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "to_liquid", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Date", + "files": [ + [ + "lib/liquid/extensions.rb", + 55 + ] + ], + "source": "def to_liquid\n self\nend", + "signature": "def to_liquid", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + } + ], + "constants": [ + + ], + "instance_attributes": { + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "TrueClass", + "namespace_type": "YARD::CodeObjects::RootObject", + "namespace_name": "root", + "files": [ + [ + "lib/liquid/extensions.rb", + 60 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": null, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "to_liquid", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "TrueClass", + "files": [ + [ + "lib/liquid/extensions.rb", + 61 + ] + ], + "source": "def to_liquid # :nodoc:\n self\nend", + "signature": "def to_liquid", + "docstring": ":nodoc:", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + } + ], + "constants": [ + + ], + "instance_attributes": { + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "FalseClass", + "namespace_type": "YARD::CodeObjects::RootObject", + "namespace_name": "root", + "files": [ + [ + "lib/liquid/extensions.rb", + 66 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": null, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "to_liquid", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "FalseClass", + "files": [ + [ + "lib/liquid/extensions.rb", + 67 + ] + ], + "source": "def to_liquid # :nodoc:\n self\nend", + "signature": "def to_liquid", + "docstring": ":nodoc:", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + } + ], + "constants": [ + + ], + "instance_attributes": { + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "NilClass", + "namespace_type": "YARD::CodeObjects::RootObject", + "namespace_name": "root", + "files": [ + [ + "lib/liquid/extensions.rb", + 72 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": null, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "to_liquid", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "NilClass", + "files": [ + [ + "lib/liquid/extensions.rb", + 73 + ] + ], + "source": "def to_liquid # :nodoc:\n self\nend", + "signature": "def to_liquid", + "docstring": ":nodoc:", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + } + ], + "constants": [ + + ], + "instance_attributes": { + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "Interrupt", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/interrupts.rb", + 5 + ] + ], + "source": null, + "signature": null, + "docstring": "An interrupt is any command that breaks processing of a block (ex: a for loop).", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "message", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Interrupt", + "files": [ + [ + "lib/liquid/interrupts.rb", + 6 + ] + ], + "source": "def message\n @message\nend", + "signature": "def message", + "docstring": "Returns the value of attribute message.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "initialize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Interrupt", + "files": [ + [ + "lib/liquid/interrupts.rb", + 8 + ] + ], + "source": "def initialize(message = nil)\n @message = message || \"interrupt\"\nend", + "signature": "def initialize(message = nil)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "a new instance of Interrupt", + "types": [ + "Interrupt" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "message", + "nil" + ] + ], + "aliases": [ + + ] + } + ], + "constants": [ + + ], + "instance_attributes": { + "message": { + "read": "Liquid::Interrupt#message", + "write": null + } + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "BreakInterrupt", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/interrupts.rb", + 14 + ] + ], + "source": null, + "signature": null, + "docstring": "Interrupt that is thrown whenever a {% break %} is called.", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "message", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Interrupt", + "files": [ + [ + "lib/liquid/interrupts.rb", + 6 + ] + ], + "source": "def message\n @message\nend", + "signature": "def message", + "docstring": "Returns the value of attribute message.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "initialize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Interrupt", + "files": [ + [ + "lib/liquid/interrupts.rb", + 8 + ] + ], + "source": "def initialize(message = nil)\n @message = message || \"interrupt\"\nend", + "signature": "def initialize(message = nil)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "a new instance of Interrupt", + "types": [ + "Interrupt" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "message", + "nil" + ] + ], + "aliases": [ + + ] + } + ], + "constants": [ + + ], + "instance_attributes": { + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "ContinueInterrupt", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/interrupts.rb", + 17 + ] + ], + "source": null, + "signature": null, + "docstring": "Interrupt that is thrown whenever a {% continue %} is called.", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "message", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Interrupt", + "files": [ + [ + "lib/liquid/interrupts.rb", + 6 + ] + ], + "source": "def message\n @message\nend", + "signature": "def message", + "docstring": "Returns the value of attribute message.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "initialize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Interrupt", + "files": [ + [ + "lib/liquid/interrupts.rb", + 8 + ] + ], + "source": "def initialize(message = nil)\n @message = message || \"interrupt\"\nend", + "signature": "def initialize(message = nil)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "a new instance of Interrupt", + "types": [ + "Interrupt" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "message", + "nil" + ] + ], + "aliases": [ + + ] + } + ], + "constants": [ + + ], + "instance_attributes": { + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "Break", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/tags/break.rb", + 13 + ] + ], + "source": null, + "signature": null, + "docstring": "Break tag to be used to break out of a for loop.\n\n== Basic Usage:\n {% for item in collection %}\n {% if item.condition %}\n {% break %}\n {% endif %}\n {% endfor %}", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "render_to_output_buffer", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Break", + "files": [ + [ + "lib/liquid/tags/break.rb", + 16 + ] + ], + "source": "def render_to_output_buffer(context, output)\n context.push_interrupt(INTERRUPT)\n output\nend", + "signature": "def render_to_output_buffer(context, output)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "context", + null + ], + [ + "output", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "nodelist", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def nodelist\n @nodelist\nend", + "signature": "def nodelist", + "docstring": "Returns the value of attribute nodelist.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "tag_name", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def tag_name\n @tag_name\nend", + "signature": "def tag_name", + "docstring": "Returns the value of attribute tag_name.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "line_number", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def line_number\n @line_number\nend", + "signature": "def line_number", + "docstring": "Returns the value of attribute line_number.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_context", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def parse_context\n @parse_context\nend", + "signature": "def parse_context", + "docstring": "Returns the value of attribute parse_context.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + "Liquid::Tag#options" + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "options", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 6 + ] + ], + "source": "def parse_context\n @parse_context\nend", + "signature": "def parse_context", + "docstring": "Returns the value of attribute parse_context.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 10 + ] + ], + "source": "def parse(tag_name, markup, tokenizer, parse_context)\n tag = new(tag_name, markup, parse_context)\n tag.parse(tokenizer)\n tag\nend", + "signature": "def parse(tag_name, markup, tokenizer, parse_context)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "tag_name", + null + ], + [ + "markup", + null + ], + [ + "tokenizer", + null + ], + [ + "parse_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "disable_tags", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 16 + ] + ], + "source": "def disable_tags(*tag_names)\n @disabled_tags ||= []\n @disabled_tags.concat(tag_names)\n prepend(Disabler)\nend", + "signature": "def disable_tags(*tag_names)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "*tag_names", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "initialize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 25 + ] + ], + "source": "def initialize(tag_name, markup, parse_context)\n @tag_name = tag_name\n @markup = markup\n @parse_context = parse_context\n @line_number = parse_context.line_number\nend", + "signature": "def initialize(tag_name, markup, parse_context)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "a new instance of Tag", + "types": [ + "Tag" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "tag_name", + null + ], + [ + "markup", + null + ], + [ + "parse_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 32 + ] + ], + "source": "def parse(_tokens)\nend", + "signature": "def parse(_tokens)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "_tokens", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "raw", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 35 + ] + ], + "source": "def raw\n \"#{@tag_name} #{@markup}\"\nend", + "signature": "def raw", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "name", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 39 + ] + ], + "source": "def name\n self.class.name.downcase\nend", + "signature": "def name", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "render", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 43 + ] + ], + "source": "def render(_context)\n ''\nend", + "signature": "def render(_context)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "blank?", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 55 + ] + ], + "source": "def blank?\n false\nend", + "signature": "def blank?", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "", + "types": [ + "Boolean" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_expression", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 61 + ] + ], + "source": "def parse_expression(markup)\n parse_context.parse_expression(markup)\nend", + "signature": "def parse_expression(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "strict_parse_with_error_mode_fallback", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 5 + ] + ], + "source": "def strict_parse_with_error_mode_fallback(markup)\n strict_parse_with_error_context(markup)\nrescue SyntaxError => e\n case parse_context.error_mode\n when :strict\n raise\n when :warn\n parse_context.warnings << e\n end\n lax_parse(markup)\nend", + "signature": "def strict_parse_with_error_mode_fallback(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_with_selected_parser", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 17 + ] + ], + "source": "def parse_with_selected_parser(markup)\n case parse_context.error_mode\n when :strict then strict_parse_with_error_context(markup)\n when :lax then lax_parse(markup)\n when :warn\n begin\n strict_parse_with_error_context(markup)\n rescue SyntaxError => e\n parse_context.warnings << e\n lax_parse(markup)\n end\n end\nend", + "signature": "def parse_with_selected_parser(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "strict_parse_with_error_context", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 33 + ] + ], + "source": "def strict_parse_with_error_context(markup)\n strict_parse(markup)\nrescue SyntaxError => e\n e.line_number = line_number\n e.markup_context = markup_context(markup)\n raise e\nend", + "signature": "def strict_parse_with_error_context(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "markup_context", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 41 + ] + ], + "source": "def markup_context(markup)\n \"in \\\"#{markup.strip}\\\"\"\nend", + "signature": "def markup_context(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + } + ], + "constants": [ + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "INTERRUPT", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Break", + "files": [ + [ + "lib/liquid/tags/break.rb", + 14 + ] + ], + "source": "INTERRUPT = BreakInterrupt.new.freeze", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "BreakInterrupt.new.freeze" + } + ], + "instance_attributes": { + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "Cycle", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/tags/cycle.rb", + 16 + ] + ], + "source": null, + "signature": null, + "docstring": "Cycle is usually used within a loop to alternate between values, like colors or DOM classes.\n\n {% for item in items %}\n
{{ item }}
\n {% end %}\n\n
Item one
\n
Item two
\n
Item three
\n
Item four
\n
Item five
", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "variables", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Cycle", + "files": [ + [ + "lib/liquid/tags/cycle.rb", + 20 + ] + ], + "source": "def variables\n @variables\nend", + "signature": "def variables", + "docstring": "Returns the value of attribute variables.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "initialize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Cycle", + "files": [ + [ + "lib/liquid/tags/cycle.rb", + 22 + ] + ], + "source": "def initialize(tag_name, markup, options)\n super\n case markup\n when NamedSyntax\n @variables = variables_from_string(Regexp.last_match(2))\n @name = parse_expression(Regexp.last_match(1))\n when SimpleSyntax\n @variables = variables_from_string(markup)\n @name = @variables.to_s\n else\n raise SyntaxError, options[:locale].t(\"errors.syntax.cycle\")\n end\nend", + "signature": "def initialize(tag_name, markup, options)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "a new instance of Cycle", + "types": [ + "Cycle" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "tag_name", + null + ], + [ + "markup", + null + ], + [ + "options", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "render_to_output_buffer", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Cycle", + "files": [ + [ + "lib/liquid/tags/cycle.rb", + 36 + ] + ], + "source": "def render_to_output_buffer(context, output)\n context.registers[:cycle] ||= {}\n\n key = context.evaluate(@name)\n iteration = context.registers[:cycle][key].to_i\n\n val = context.evaluate(@variables[iteration])\n\n if val.is_a?(Array)\n val = val.join\n elsif !val.is_a?(String)\n val = val.to_s\n end\n\n output << val\n\n iteration += 1\n iteration = 0 if iteration >= @variables.size\n\n context.registers[:cycle][key] = iteration\n output\nend", + "signature": "def render_to_output_buffer(context, output)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "context", + null + ], + [ + "output", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "variables_from_string", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Cycle", + "files": [ + [ + "lib/liquid/tags/cycle.rb", + 61 + ] + ], + "source": "def variables_from_string(markup)\n markup.split(',').collect do |var|\n var =~ /\\s*(#{QuotedFragment})\\s*/o\n Regexp.last_match(1) ? parse_expression(Regexp.last_match(1)) : nil\n end.compact\nend", + "signature": "def variables_from_string(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "nodelist", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def nodelist\n @nodelist\nend", + "signature": "def nodelist", + "docstring": "Returns the value of attribute nodelist.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "tag_name", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def tag_name\n @tag_name\nend", + "signature": "def tag_name", + "docstring": "Returns the value of attribute tag_name.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "line_number", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def line_number\n @line_number\nend", + "signature": "def line_number", + "docstring": "Returns the value of attribute line_number.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_context", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def parse_context\n @parse_context\nend", + "signature": "def parse_context", + "docstring": "Returns the value of attribute parse_context.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + "Liquid::Tag#options" + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "options", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 6 + ] + ], + "source": "def parse_context\n @parse_context\nend", + "signature": "def parse_context", + "docstring": "Returns the value of attribute parse_context.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 10 + ] + ], + "source": "def parse(tag_name, markup, tokenizer, parse_context)\n tag = new(tag_name, markup, parse_context)\n tag.parse(tokenizer)\n tag\nend", + "signature": "def parse(tag_name, markup, tokenizer, parse_context)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "tag_name", + null + ], + [ + "markup", + null + ], + [ + "tokenizer", + null + ], + [ + "parse_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "disable_tags", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 16 + ] + ], + "source": "def disable_tags(*tag_names)\n @disabled_tags ||= []\n @disabled_tags.concat(tag_names)\n prepend(Disabler)\nend", + "signature": "def disable_tags(*tag_names)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "*tag_names", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 32 + ] + ], + "source": "def parse(_tokens)\nend", + "signature": "def parse(_tokens)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "_tokens", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "raw", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 35 + ] + ], + "source": "def raw\n \"#{@tag_name} #{@markup}\"\nend", + "signature": "def raw", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "name", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 39 + ] + ], + "source": "def name\n self.class.name.downcase\nend", + "signature": "def name", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "render", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 43 + ] + ], + "source": "def render(_context)\n ''\nend", + "signature": "def render(_context)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "blank?", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 55 + ] + ], + "source": "def blank?\n false\nend", + "signature": "def blank?", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "", + "types": [ + "Boolean" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_expression", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 61 + ] + ], + "source": "def parse_expression(markup)\n parse_context.parse_expression(markup)\nend", + "signature": "def parse_expression(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "strict_parse_with_error_mode_fallback", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 5 + ] + ], + "source": "def strict_parse_with_error_mode_fallback(markup)\n strict_parse_with_error_context(markup)\nrescue SyntaxError => e\n case parse_context.error_mode\n when :strict\n raise\n when :warn\n parse_context.warnings << e\n end\n lax_parse(markup)\nend", + "signature": "def strict_parse_with_error_mode_fallback(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_with_selected_parser", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 17 + ] + ], + "source": "def parse_with_selected_parser(markup)\n case parse_context.error_mode\n when :strict then strict_parse_with_error_context(markup)\n when :lax then lax_parse(markup)\n when :warn\n begin\n strict_parse_with_error_context(markup)\n rescue SyntaxError => e\n parse_context.warnings << e\n lax_parse(markup)\n end\n end\nend", + "signature": "def parse_with_selected_parser(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "strict_parse_with_error_context", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 33 + ] + ], + "source": "def strict_parse_with_error_context(markup)\n strict_parse(markup)\nrescue SyntaxError => e\n e.line_number = line_number\n e.markup_context = markup_context(markup)\n raise e\nend", + "signature": "def strict_parse_with_error_context(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "markup_context", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 41 + ] + ], + "source": "def markup_context(markup)\n \"in \\\"#{markup.strip}\\\"\"\nend", + "signature": "def markup_context(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + } + ], + "constants": [ + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "SimpleSyntax", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Cycle", + "files": [ + [ + "lib/liquid/tags/cycle.rb", + 17 + ] + ], + "source": "SimpleSyntax = /\\A#{QuotedFragment}+/o", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "/\\A#{QuotedFragment}+/o" + }, + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "NamedSyntax", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Cycle", + "files": [ + [ + "lib/liquid/tags/cycle.rb", + 18 + ] + ], + "source": "NamedSyntax = /\\A(#{QuotedFragment})\\s*\\:\\s*(.*)/om", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "/\\A(#{QuotedFragment})\\s*\\:\\s*(.*)/om" + } + ], + "instance_attributes": { + "variables": { + "read": "Liquid::Cycle#variables", + "write": null + } + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "ParseTreeVisitor", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Cycle", + "files": [ + [ + "lib/liquid/tags/cycle.rb", + 68 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "children", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/tags/cycle.rb", + 69 + ] + ], + "source": "def children\n Array(@node.variables)\nend", + "signature": "def children", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "for", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/parse_tree_visitor.rb", + 5 + ] + ], + "source": "def self.for(node, callbacks = Hash.new(proc {}))\n if defined?(node.class::ParseTreeVisitor)\n node.class::ParseTreeVisitor\n else\n self\n end.new(node, callbacks)\nend", + "signature": "def for(node, callbacks = Hash.new(proc {}))", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "node", + null + ], + [ + "callbacks", + "Hash.new(proc {})" + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "initialize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/parse_tree_visitor.rb", + 13 + ] + ], + "source": "def initialize(node, callbacks)\n @node = node\n @callbacks = callbacks\nend", + "signature": "def initialize(node, callbacks)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "a new instance of ParseTreeVisitor", + "types": [ + "ParseTreeVisitor" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "node", + null + ], + [ + "callbacks", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "add_callback_for", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/parse_tree_visitor.rb", + 18 + ] + ], + "source": "def add_callback_for(*classes, &block)\n callback = block\n callback = ->(node, _) { yield node } if block.arity.abs == 1\n callback = ->(_, _) { yield } if block.arity.zero?\n classes.each { |klass| @callbacks[klass] = callback }\n self\nend", + "signature": "def add_callback_for(*classes, &block)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "*classes", + null + ], + [ + "&block", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "visit", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/parse_tree_visitor.rb", + 26 + ] + ], + "source": "def visit(context = nil)\n children.map do |node|\n item, new_context = @callbacks[node.class].call(node, context)\n [\n item,\n ParseTreeVisitor.for(node, @callbacks).visit(new_context || context),\n ]\n end\nend", + "signature": "def visit(context = nil)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "context", + "nil" + ] + ], + "aliases": [ + + ] + } + ], + "constants": [ + + ], + "instance_attributes": { + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "BlankFileSystem", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/file_system.rb", + 17 + ] + ], + "source": null, + "signature": null, + "docstring": "A Liquid file system is a way to let your templates retrieve other templates for use with the include tag.\n\nYou can implement subclasses that retrieve templates from the database, from the file system using a different\npath structure, you can provide them as hard-coded inline strings, or any manner that you see fit.\n\nYou can add additional instance variables, arguments, or methods as needed.\n\nExample:\n\n Liquid::Template.file_system = Liquid::LocalFileSystem.new(template_path)\n liquid = Liquid::Template.parse(template)\n\nThis will parse the template with a LocalFileSystem implementation rooted at 'template_path'.", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "read_template_file", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "BlankFileSystem", + "files": [ + [ + "lib/liquid/file_system.rb", + 19 + ] + ], + "source": "def read_template_file(_template_path)\n raise FileSystemError, \"This liquid context does not allow includes.\"\nend", + "signature": "def read_template_file(_template_path)", + "docstring": "Called by Liquid to retrieve a template file", + "dynamic": true, + "tags": [ + { + "tag_name": "raise", + "text": "", + "types": [ + "FileSystemError" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "_template_path", + null + ] + ], + "aliases": [ + + ] + } + ], + "constants": [ + + ], + "instance_attributes": { + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "LocalFileSystem", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/file_system.rb", + 46 + ] + ], + "source": null, + "signature": null, + "docstring": "This implements an abstract file system which retrieves template files named in a manner similar to Rails partials,\nie. with the template name prefixed with an underscore. The extension \".liquid\" is also added.\n\nFor security reasons, template paths are only allowed to contain letters, numbers, and underscore.\n\nExample:\n\n file_system = Liquid::LocalFileSystem.new(\"/some/path\")\n\n file_system.full_path(\"mypartial\") # => \"/some/path/_mypartial.liquid\"\n file_system.full_path(\"dir/mypartial\") # => \"/some/path/dir/_mypartial.liquid\"\n\nOptionally in the second argument you can specify a custom pattern for template filenames.\nThe Kernel::sprintf format specification is used.\nDefault pattern is \"_%s.liquid\".\n\nExample:\n\n file_system = Liquid::LocalFileSystem.new(\"/some/path\", \"%s.html\")\n\n file_system.full_path(\"index\") # => \"/some/path/index.html\"", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "root", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "LocalFileSystem", + "files": [ + [ + "lib/liquid/file_system.rb", + 47 + ] + ], + "source": "def root\n @root\nend", + "signature": "def root", + "docstring": "Returns the value of attribute root.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "root=", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "LocalFileSystem", + "files": [ + [ + "lib/liquid/file_system.rb", + 47 + ] + ], + "source": "def root=(value)\n @root = value\nend", + "signature": "def root=(value)", + "docstring": "Sets the attribute root", + "dynamic": true, + "tags": [ + { + "tag_name": "param", + "text": "the value to set the attribute root to.", + "types": null, + "name": "value" + } + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + [ + "value", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "initialize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "LocalFileSystem", + "files": [ + [ + "lib/liquid/file_system.rb", + 49 + ] + ], + "source": "def initialize(root, pattern = \"_%s.liquid\")\n @root = root\n @pattern = pattern\nend", + "signature": "def initialize(root, pattern = \"_%s.liquid\")", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "a new instance of LocalFileSystem", + "types": [ + "LocalFileSystem" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "root", + null + ], + [ + "pattern", + "\"_%s.liquid\"" + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "read_template_file", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "LocalFileSystem", + "files": [ + [ + "lib/liquid/file_system.rb", + 54 + ] + ], + "source": "def read_template_file(template_path)\n full_path = full_path(template_path)\n raise FileSystemError, \"No such template '#{template_path}'\" unless File.exist?(full_path)\n\n File.read(full_path)\nend", + "signature": "def read_template_file(template_path)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "raise", + "text": "", + "types": [ + "FileSystemError" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "template_path", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "full_path", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "LocalFileSystem", + "files": [ + [ + "lib/liquid/file_system.rb", + 61 + ] + ], + "source": "def full_path(template_path)\n raise FileSystemError, \"Illegal template name '#{template_path}'\" unless %r{\\A[^./][a-zA-Z0-9_/]+\\z}.match?(template_path)\n\n full_path = if template_path.include?('/')\n File.join(root, File.dirname(template_path), @pattern % File.basename(template_path))\n else\n File.join(root, @pattern % template_path)\n end\n\n raise FileSystemError, \"Illegal template path '#{File.expand_path(full_path)}'\" unless File.expand_path(full_path).start_with?(File.expand_path(root))\n\n full_path\nend", + "signature": "def full_path(template_path)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "raise", + "text": "", + "types": [ + "FileSystemError" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "template_path", + null + ] + ], + "aliases": [ + + ] + } + ], + "constants": [ + + ], + "instance_attributes": { + "root": { + "read": "Liquid::LocalFileSystem#root", + "write": "Liquid::LocalFileSystem#root=" + } + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "Assign", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/tags/assign.rb", + 12 + ] + ], + "source": null, + "signature": null, + "docstring": "Assign sets a variable in your template.\n\n {% assign foo = 'monkey' %}\n\nYou can then use the variable later in the page.\n\n {{ foo }}", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "raise_syntax_error", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Assign", + "files": [ + [ + "lib/liquid/tags/assign.rb", + 16 + ] + ], + "source": "def self.raise_syntax_error(parse_context)\n raise Liquid::SyntaxError, parse_context.locale.t('errors.syntax.assign')\nend", + "signature": "def raise_syntax_error(parse_context)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "api", + "text": "private", + "types": null, + "name": null + }, + { + "tag_name": "raise", + "text": "", + "types": [ + "Liquid::SyntaxError" + ], + "name": null + } + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "parse_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "to", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Assign", + "files": [ + [ + "lib/liquid/tags/assign.rb", + 20 + ] + ], + "source": "def to\n @to\nend", + "signature": "def to", + "docstring": "Returns the value of attribute to.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "from", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Assign", + "files": [ + [ + "lib/liquid/tags/assign.rb", + 20 + ] + ], + "source": "def from\n @from\nend", + "signature": "def from", + "docstring": "Returns the value of attribute from.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "initialize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Assign", + "files": [ + [ + "lib/liquid/tags/assign.rb", + 22 + ] + ], + "source": "def initialize(tag_name, markup, parse_context)\n super\n if markup =~ Syntax\n @to = Regexp.last_match(1)\n @from = Variable.new(Regexp.last_match(2), parse_context)\n else\n self.class.raise_syntax_error(parse_context)\n end\nend", + "signature": "def initialize(tag_name, markup, parse_context)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "a new instance of Assign", + "types": [ + "Assign" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "tag_name", + null + ], + [ + "markup", + null + ], + [ + "parse_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "render_to_output_buffer", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Assign", + "files": [ + [ + "lib/liquid/tags/assign.rb", + 32 + ] + ], + "source": "def render_to_output_buffer(context, output)\n val = @from.render(context)\n context.scopes.last[@to] = val\n context.resource_limits.increment_assign_score(assign_score_of(val))\n output\nend", + "signature": "def render_to_output_buffer(context, output)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "context", + null + ], + [ + "output", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "blank?", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Assign", + "files": [ + [ + "lib/liquid/tags/assign.rb", + 39 + ] + ], + "source": "def blank?\n true\nend", + "signature": "def blank?", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "", + "types": [ + "Boolean" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "assign_score_of", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Assign", + "files": [ + [ + "lib/liquid/tags/assign.rb", + 45 + ] + ], + "source": "def assign_score_of(val)\n if val.instance_of?(String)\n val.bytesize\n elsif val.instance_of?(Array)\n sum = 1\n # Uses #each to avoid extra allocations.\n val.each { |child| sum += assign_score_of(child) }\n sum\n elsif val.instance_of?(Hash)\n sum = 1\n val.each do |key, entry_value|\n sum += assign_score_of(key)\n sum += assign_score_of(entry_value)\n end\n sum\n else\n 1\n end\nend", + "signature": "def assign_score_of(val)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "val", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "nodelist", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def nodelist\n @nodelist\nend", + "signature": "def nodelist", + "docstring": "Returns the value of attribute nodelist.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "tag_name", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def tag_name\n @tag_name\nend", + "signature": "def tag_name", + "docstring": "Returns the value of attribute tag_name.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "line_number", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def line_number\n @line_number\nend", + "signature": "def line_number", + "docstring": "Returns the value of attribute line_number.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_context", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def parse_context\n @parse_context\nend", + "signature": "def parse_context", + "docstring": "Returns the value of attribute parse_context.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + "Liquid::Tag#options" + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "options", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 6 + ] + ], + "source": "def parse_context\n @parse_context\nend", + "signature": "def parse_context", + "docstring": "Returns the value of attribute parse_context.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 10 + ] + ], + "source": "def parse(tag_name, markup, tokenizer, parse_context)\n tag = new(tag_name, markup, parse_context)\n tag.parse(tokenizer)\n tag\nend", + "signature": "def parse(tag_name, markup, tokenizer, parse_context)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "tag_name", + null + ], + [ + "markup", + null + ], + [ + "tokenizer", + null + ], + [ + "parse_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "disable_tags", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 16 + ] + ], + "source": "def disable_tags(*tag_names)\n @disabled_tags ||= []\n @disabled_tags.concat(tag_names)\n prepend(Disabler)\nend", + "signature": "def disable_tags(*tag_names)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "*tag_names", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 32 + ] + ], + "source": "def parse(_tokens)\nend", + "signature": "def parse(_tokens)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "_tokens", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "raw", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 35 + ] + ], + "source": "def raw\n \"#{@tag_name} #{@markup}\"\nend", + "signature": "def raw", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "name", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 39 + ] + ], + "source": "def name\n self.class.name.downcase\nend", + "signature": "def name", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "render", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 43 + ] + ], + "source": "def render(_context)\n ''\nend", + "signature": "def render(_context)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_expression", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 61 + ] + ], + "source": "def parse_expression(markup)\n parse_context.parse_expression(markup)\nend", + "signature": "def parse_expression(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "strict_parse_with_error_mode_fallback", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 5 + ] + ], + "source": "def strict_parse_with_error_mode_fallback(markup)\n strict_parse_with_error_context(markup)\nrescue SyntaxError => e\n case parse_context.error_mode\n when :strict\n raise\n when :warn\n parse_context.warnings << e\n end\n lax_parse(markup)\nend", + "signature": "def strict_parse_with_error_mode_fallback(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_with_selected_parser", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 17 + ] + ], + "source": "def parse_with_selected_parser(markup)\n case parse_context.error_mode\n when :strict then strict_parse_with_error_context(markup)\n when :lax then lax_parse(markup)\n when :warn\n begin\n strict_parse_with_error_context(markup)\n rescue SyntaxError => e\n parse_context.warnings << e\n lax_parse(markup)\n end\n end\nend", + "signature": "def parse_with_selected_parser(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "strict_parse_with_error_context", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 33 + ] + ], + "source": "def strict_parse_with_error_context(markup)\n strict_parse(markup)\nrescue SyntaxError => e\n e.line_number = line_number\n e.markup_context = markup_context(markup)\n raise e\nend", + "signature": "def strict_parse_with_error_context(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "markup_context", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 41 + ] + ], + "source": "def markup_context(markup)\n \"in \\\"#{markup.strip}\\\"\"\nend", + "signature": "def markup_context(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + } + ], + "constants": [ + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "Syntax", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Assign", + "files": [ + [ + "lib/liquid/tags/assign.rb", + 13 + ] + ], + "source": "Syntax = /(#{VariableSignature}+)\\s*=\\s*(.*)\\s*/om", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "/(#{VariableSignature}+)\\s*=\\s*(.*)\\s*/om" + } + ], + "instance_attributes": { + "to": { + "read": "Liquid::Assign#to", + "write": null + }, + "from": { + "read": "Liquid::Assign#from", + "write": null + } + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "ParseTreeVisitor", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Assign", + "files": [ + [ + "lib/liquid/tags/assign.rb", + 65 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "children", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/tags/assign.rb", + 66 + ] + ], + "source": "def children\n [@node.from]\nend", + "signature": "def children", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "for", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/parse_tree_visitor.rb", + 5 + ] + ], + "source": "def self.for(node, callbacks = Hash.new(proc {}))\n if defined?(node.class::ParseTreeVisitor)\n node.class::ParseTreeVisitor\n else\n self\n end.new(node, callbacks)\nend", + "signature": "def for(node, callbacks = Hash.new(proc {}))", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "node", + null + ], + [ + "callbacks", + "Hash.new(proc {})" + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "initialize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/parse_tree_visitor.rb", + 13 + ] + ], + "source": "def initialize(node, callbacks)\n @node = node\n @callbacks = callbacks\nend", + "signature": "def initialize(node, callbacks)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "a new instance of ParseTreeVisitor", + "types": [ + "ParseTreeVisitor" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "node", + null + ], + [ + "callbacks", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "add_callback_for", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/parse_tree_visitor.rb", + 18 + ] + ], + "source": "def add_callback_for(*classes, &block)\n callback = block\n callback = ->(node, _) { yield node } if block.arity.abs == 1\n callback = ->(_, _) { yield } if block.arity.zero?\n classes.each { |klass| @callbacks[klass] = callback }\n self\nend", + "signature": "def add_callback_for(*classes, &block)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "*classes", + null + ], + [ + "&block", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "visit", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/parse_tree_visitor.rb", + 26 + ] + ], + "source": "def visit(context = nil)\n children.map do |node|\n item, new_context = @callbacks[node.class].call(node, context)\n [\n item,\n ParseTreeVisitor.for(node, @callbacks).visit(new_context || context),\n ]\n end\nend", + "signature": "def visit(context = nil)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "context", + "nil" + ] + ], + "aliases": [ + + ] + } + ], + "constants": [ + + ], + "instance_attributes": { + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "Render", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/tags/render.rb", + 4 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "template_name_expr", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Render", + "files": [ + [ + "lib/liquid/tags/render.rb", + 10 + ] + ], + "source": "def template_name_expr\n @template_name_expr\nend", + "signature": "def template_name_expr", + "docstring": "Returns the value of attribute template_name_expr.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "attributes", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Render", + "files": [ + [ + "lib/liquid/tags/render.rb", + 10 + ] + ], + "source": "def attributes\n @attributes\nend", + "signature": "def attributes", + "docstring": "Returns the value of attribute attributes.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "initialize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Render", + "files": [ + [ + "lib/liquid/tags/render.rb", + 12 + ] + ], + "source": "def initialize(tag_name, markup, options)\n super\n\n raise SyntaxError, options[:locale].t(\"errors.syntax.render\") unless markup =~ SYNTAX\n\n template_name = Regexp.last_match(1)\n with_or_for = Regexp.last_match(3)\n variable_name = Regexp.last_match(4)\n\n @alias_name = Regexp.last_match(6)\n @variable_name_expr = variable_name ? parse_expression(variable_name) : nil\n @template_name_expr = parse_expression(template_name)\n @for = (with_or_for == FOR)\n\n @attributes = {}\n markup.scan(TagAttributes) do |key, value|\n @attributes[key] = parse_expression(value)\n end\nend", + "signature": "def initialize(tag_name, markup, options)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "raise", + "text": "", + "types": [ + "SyntaxError" + ], + "name": null + }, + { + "tag_name": "return", + "text": "a new instance of Render", + "types": [ + "Render" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "tag_name", + null + ], + [ + "markup", + null + ], + [ + "options", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "render_to_output_buffer", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Render", + "files": [ + [ + "lib/liquid/tags/render.rb", + 32 + ] + ], + "source": "def render_to_output_buffer(context, output)\n render_tag(context, output)\nend", + "signature": "def render_to_output_buffer(context, output)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "context", + null + ], + [ + "output", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "render_tag", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Render", + "files": [ + [ + "lib/liquid/tags/render.rb", + 36 + ] + ], + "source": "def render_tag(context, output)\n # Though we evaluate this here we will only ever parse it as a string literal.\n template_name = context.evaluate(@template_name_expr)\n raise ArgumentError, options[:locale].t(\"errors.argument.include\") unless template_name\n\n partial = PartialCache.load(\n template_name,\n context: context,\n parse_context: parse_context\n )\n\n context_variable_name = @alias_name || template_name.split('/').last\n\n render_partial_func = ->(var, forloop) {\n inner_context = context.new_isolated_subcontext\n inner_context.template_name = template_name\n inner_context.partial = true\n inner_context['forloop'] = forloop if forloop\n\n @attributes.each do |key, value|\n inner_context[key] = context.evaluate(value)\n end\n inner_context[context_variable_name] = var unless var.nil?\n partial.render_to_output_buffer(inner_context, output)\n forloop&.send(:increment!)\n }\n\n variable = @variable_name_expr ? context.evaluate(@variable_name_expr) : nil\n if @for && variable.respond_to?(:each) && variable.respond_to?(:count)\n forloop = Liquid::ForloopDrop.new(template_name, variable.count, nil)\n variable.each { |var| render_partial_func.call(var, forloop) }\n else\n render_partial_func.call(variable, nil)\n end\n\n output\nend", + "signature": "def render_tag(context, output)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "raise", + "text": "", + "types": [ + "ArgumentError" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "context", + null + ], + [ + "output", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "nodelist", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def nodelist\n @nodelist\nend", + "signature": "def nodelist", + "docstring": "Returns the value of attribute nodelist.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "tag_name", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def tag_name\n @tag_name\nend", + "signature": "def tag_name", + "docstring": "Returns the value of attribute tag_name.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "line_number", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def line_number\n @line_number\nend", + "signature": "def line_number", + "docstring": "Returns the value of attribute line_number.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_context", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def parse_context\n @parse_context\nend", + "signature": "def parse_context", + "docstring": "Returns the value of attribute parse_context.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + "Liquid::Tag#options" + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "options", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 6 + ] + ], + "source": "def parse_context\n @parse_context\nend", + "signature": "def parse_context", + "docstring": "Returns the value of attribute parse_context.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 10 + ] + ], + "source": "def parse(tag_name, markup, tokenizer, parse_context)\n tag = new(tag_name, markup, parse_context)\n tag.parse(tokenizer)\n tag\nend", + "signature": "def parse(tag_name, markup, tokenizer, parse_context)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "tag_name", + null + ], + [ + "markup", + null + ], + [ + "tokenizer", + null + ], + [ + "parse_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "disable_tags", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 16 + ] + ], + "source": "def disable_tags(*tag_names)\n @disabled_tags ||= []\n @disabled_tags.concat(tag_names)\n prepend(Disabler)\nend", + "signature": "def disable_tags(*tag_names)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "*tag_names", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 32 + ] + ], + "source": "def parse(_tokens)\nend", + "signature": "def parse(_tokens)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "_tokens", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "raw", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 35 + ] + ], + "source": "def raw\n \"#{@tag_name} #{@markup}\"\nend", + "signature": "def raw", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "name", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 39 + ] + ], + "source": "def name\n self.class.name.downcase\nend", + "signature": "def name", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "render", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 43 + ] + ], + "source": "def render(_context)\n ''\nend", + "signature": "def render(_context)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "blank?", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 55 + ] + ], + "source": "def blank?\n false\nend", + "signature": "def blank?", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "", + "types": [ + "Boolean" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_expression", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 61 + ] + ], + "source": "def parse_expression(markup)\n parse_context.parse_expression(markup)\nend", + "signature": "def parse_expression(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "strict_parse_with_error_mode_fallback", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 5 + ] + ], + "source": "def strict_parse_with_error_mode_fallback(markup)\n strict_parse_with_error_context(markup)\nrescue SyntaxError => e\n case parse_context.error_mode\n when :strict\n raise\n when :warn\n parse_context.warnings << e\n end\n lax_parse(markup)\nend", + "signature": "def strict_parse_with_error_mode_fallback(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_with_selected_parser", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 17 + ] + ], + "source": "def parse_with_selected_parser(markup)\n case parse_context.error_mode\n when :strict then strict_parse_with_error_context(markup)\n when :lax then lax_parse(markup)\n when :warn\n begin\n strict_parse_with_error_context(markup)\n rescue SyntaxError => e\n parse_context.warnings << e\n lax_parse(markup)\n end\n end\nend", + "signature": "def parse_with_selected_parser(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "strict_parse_with_error_context", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 33 + ] + ], + "source": "def strict_parse_with_error_context(markup)\n strict_parse(markup)\nrescue SyntaxError => e\n e.line_number = line_number\n e.markup_context = markup_context(markup)\n raise e\nend", + "signature": "def strict_parse_with_error_context(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "markup_context", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 41 + ] + ], + "source": "def markup_context(markup)\n \"in \\\"#{markup.strip}\\\"\"\nend", + "signature": "def markup_context(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + } + ], + "constants": [ + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "FOR", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Render", + "files": [ + [ + "lib/liquid/tags/render.rb", + 5 + ] + ], + "source": "FOR = 'for'", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "'for'" + }, + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "SYNTAX", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Render", + "files": [ + [ + "lib/liquid/tags/render.rb", + 6 + ] + ], + "source": "SYNTAX = /(#{QuotedString}+)(\\s+(with|#{FOR})\\s+(#{QuotedFragment}+))?(\\s+(?:as)\\s+(#{VariableSegment}+))?/o", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "/(#{QuotedString}+)(\\s+(with|#{FOR})\\s+(#{QuotedFragment}+))?(\\s+(?:as)\\s+(#{VariableSegment}+))?/o" + } + ], + "instance_attributes": { + "template_name_expr": { + "read": "Liquid::Render#template_name_expr", + "write": null + }, + "attributes": { + "read": "Liquid::Render#attributes", + "write": null + } + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "ParseTreeVisitor", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Render", + "files": [ + [ + "lib/liquid/tags/render.rb", + 74 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "children", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/tags/render.rb", + 75 + ] + ], + "source": "def children\n [\n @node.template_name_expr,\n ] + @node.attributes.values\nend", + "signature": "def children", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "for", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/parse_tree_visitor.rb", + 5 + ] + ], + "source": "def self.for(node, callbacks = Hash.new(proc {}))\n if defined?(node.class::ParseTreeVisitor)\n node.class::ParseTreeVisitor\n else\n self\n end.new(node, callbacks)\nend", + "signature": "def for(node, callbacks = Hash.new(proc {}))", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "node", + null + ], + [ + "callbacks", + "Hash.new(proc {})" + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "initialize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/parse_tree_visitor.rb", + 13 + ] + ], + "source": "def initialize(node, callbacks)\n @node = node\n @callbacks = callbacks\nend", + "signature": "def initialize(node, callbacks)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "a new instance of ParseTreeVisitor", + "types": [ + "ParseTreeVisitor" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "node", + null + ], + [ + "callbacks", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "add_callback_for", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/parse_tree_visitor.rb", + 18 + ] + ], + "source": "def add_callback_for(*classes, &block)\n callback = block\n callback = ->(node, _) { yield node } if block.arity.abs == 1\n callback = ->(_, _) { yield } if block.arity.zero?\n classes.each { |klass| @callbacks[klass] = callback }\n self\nend", + "signature": "def add_callback_for(*classes, &block)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "*classes", + null + ], + [ + "&block", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "visit", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/parse_tree_visitor.rb", + 26 + ] + ], + "source": "def visit(context = nil)\n children.map do |node|\n item, new_context = @callbacks[node.class].call(node, context)\n [\n item,\n ParseTreeVisitor.for(node, @callbacks).visit(new_context || context),\n ]\n end\nend", + "signature": "def visit(context = nil)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "context", + "nil" + ] + ], + "aliases": [ + + ] + } + ], + "constants": [ + + ], + "instance_attributes": { + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "Unless", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/tags/unless.rb", + 10 + ] + ], + "source": null, + "signature": null, + "docstring": "Unless is a conditional just like 'if' but works on the inverse logic.\n\n {% unless x < 0 %} x is greater than zero {% endunless %}", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "render_to_output_buffer", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Unless", + "files": [ + [ + "lib/liquid/tags/unless.rb", + 11 + ] + ], + "source": "def render_to_output_buffer(context, output)\n # First condition is interpreted backwards ( if not )\n first_block = @blocks.first\n result = Liquid::Utils.to_liquid_value(\n first_block.evaluate(context)\n )\n\n unless result\n return first_block.attachment.render_to_output_buffer(context, output)\n end\n\n # After the first condition unless works just like if\n @blocks[1..-1].each do |block|\n result = Liquid::Utils.to_liquid_value(\n block.evaluate(context)\n )\n\n if result\n return block.attachment.render_to_output_buffer(context, output)\n end\n end\n\n output\nend", + "signature": "def render_to_output_buffer(context, output)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "context", + null + ], + [ + "output", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "blocks", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "If", + "files": [ + [ + "lib/liquid/tags/if.rb", + 19 + ] + ], + "source": "def blocks\n @blocks\nend", + "signature": "def blocks", + "docstring": "Returns the value of attribute blocks.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "initialize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "If", + "files": [ + [ + "lib/liquid/tags/if.rb", + 21 + ] + ], + "source": "def initialize(tag_name, markup, options)\n super\n @blocks = []\n push_block('if', markup)\nend", + "signature": "def initialize(tag_name, markup, options)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "a new instance of If", + "types": [ + "If" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "tag_name", + null + ], + [ + "markup", + null + ], + [ + "options", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "nodelist", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "If", + "files": [ + [ + "lib/liquid/tags/if.rb", + 27 + ] + ], + "source": "def nodelist\n @blocks.map(&:attachment)\nend", + "signature": "def nodelist", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "If", + "files": [ + [ + "lib/liquid/tags/if.rb", + 31 + ] + ], + "source": "def parse(tokens)\n while parse_body(@blocks.last.attachment, tokens)\n end\n @blocks.reverse_each do |block|\n block.attachment.remove_blank_strings if blank?\n block.attachment.freeze\n end\nend", + "signature": "def parse(tokens)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "tokens", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "unknown_tag", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "If", + "files": [ + [ + "lib/liquid/tags/if.rb", + 43 + ] + ], + "source": "def unknown_tag(tag, markup, tokens)\n if ELSE_TAG_NAMES.include?(tag)\n push_block(tag, markup)\n else\n super\n end\nend", + "signature": "def unknown_tag(tag, markup, tokens)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "tag", + null + ], + [ + "markup", + null + ], + [ + "tokens", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "push_block", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "If", + "files": [ + [ + "lib/liquid/tags/if.rb", + 67 + ] + ], + "source": "def push_block(tag, markup)\n block = if tag == 'else'\n ElseCondition.new\n else\n parse_with_selected_parser(markup)\n end\n\n @blocks.push(block)\n block.attach(new_body)\nend", + "signature": "def push_block(tag, markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "tag", + null + ], + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_expression", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "If", + "files": [ + [ + "lib/liquid/tags/if.rb", + 78 + ] + ], + "source": "def parse_expression(markup)\n Condition.parse_expression(parse_context, markup)\nend", + "signature": "def parse_expression(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "lax_parse", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "If", + "files": [ + [ + "lib/liquid/tags/if.rb", + 82 + ] + ], + "source": "def lax_parse(markup)\n expressions = markup.scan(ExpressionsAndOperators)\n raise SyntaxError, options[:locale].t(\"errors.syntax.if\") unless expressions.pop =~ Syntax\n\n condition = Condition.new(parse_expression(Regexp.last_match(1)), Regexp.last_match(2), parse_expression(Regexp.last_match(3)))\n\n until expressions.empty?\n operator = expressions.pop.to_s.strip\n\n raise SyntaxError, options[:locale].t(\"errors.syntax.if\") unless expressions.pop.to_s =~ Syntax\n\n new_condition = Condition.new(parse_expression(Regexp.last_match(1)), Regexp.last_match(2), parse_expression(Regexp.last_match(3)))\n raise SyntaxError, options[:locale].t(\"errors.syntax.if\") unless BOOLEAN_OPERATORS.include?(operator)\n new_condition.send(operator, condition)\n condition = new_condition\n end\n\n condition\nend", + "signature": "def lax_parse(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "raise", + "text": "", + "types": [ + "SyntaxError" + ], + "name": null + } + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "strict_parse", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "If", + "files": [ + [ + "lib/liquid/tags/if.rb", + 102 + ] + ], + "source": "def strict_parse(markup)\n p = Parser.new(markup)\n condition = parse_binary_comparisons(p)\n p.consume(:end_of_string)\n condition\nend", + "signature": "def strict_parse(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_binary_comparisons", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "If", + "files": [ + [ + "lib/liquid/tags/if.rb", + 109 + ] + ], + "source": "def parse_binary_comparisons(p)\n condition = parse_comparison(p)\n first_condition = condition\n while (op = (p.id?('and') || p.id?('or')))\n child_condition = parse_comparison(p)\n condition.send(op, child_condition)\n condition = child_condition\n end\n first_condition\nend", + "signature": "def parse_binary_comparisons(p)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "p", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_comparison", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "If", + "files": [ + [ + "lib/liquid/tags/if.rb", + 120 + ] + ], + "source": "def parse_comparison(p)\n a = parse_expression(p.expression)\n if (op = p.consume?(:comparison))\n b = parse_expression(p.expression)\n Condition.new(a, op, b)\n else\n Condition.new(a)\n end\nend", + "signature": "def parse_comparison(p)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "p", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "render", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 20 + ] + ], + "source": "def render(context)\n @body.render(context)\nend", + "signature": "def render(context)", + "docstring": "For backwards compatibility", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "blank?", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 24 + ] + ], + "source": "def blank?\n @blank\nend", + "signature": "def blank?", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "", + "types": [ + "Boolean" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "raise_unknown_tag", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 37 + ] + ], + "source": "def self.raise_unknown_tag(tag, block_name, block_delimiter, parse_context)\n if tag == 'else'\n raise SyntaxError, parse_context.locale.t(\"errors.syntax.unexpected_else\",\n block_name: block_name)\n elsif tag.start_with?('end')\n raise SyntaxError, parse_context.locale.t(\"errors.syntax.invalid_delimiter\",\n tag: tag,\n block_name: block_name,\n block_delimiter: block_delimiter)\n else\n raise SyntaxError, parse_context.locale.t(\"errors.syntax.unknown_tag\", tag: tag)\n end\nend", + "signature": "def raise_unknown_tag(tag, block_name, block_delimiter, parse_context)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "api", + "text": "private", + "types": null, + "name": null + } + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "tag", + null + ], + [ + "block_name", + null + ], + [ + "block_delimiter", + null + ], + [ + "parse_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "raise_tag_never_closed", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 51 + ] + ], + "source": "def raise_tag_never_closed(block_name)\n raise SyntaxError, parse_context.locale.t(\"errors.syntax.tag_never_closed\", block_name: block_name)\nend", + "signature": "def raise_tag_never_closed(block_name)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "raise", + "text": "", + "types": [ + "SyntaxError" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "block_name", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "block_name", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 55 + ] + ], + "source": "def block_name\n @tag_name\nend", + "signature": "def block_name", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "block_delimiter", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 59 + ] + ], + "source": "def block_delimiter\n @block_delimiter ||= \"end#{block_name}\"\nend", + "signature": "def block_delimiter", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "new_body", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 66 + ] + ], + "source": "def new_body\n parse_context.new_block_body\nend", + "signature": "def new_body", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "api", + "text": "public", + "types": null, + "name": null + } + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_body", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 71 + ] + ], + "source": "def parse_body(body, tokens)\n if parse_context.depth >= MAX_DEPTH\n raise StackLevelError, \"Nesting too deep\"\n end\n parse_context.depth += 1\n begin\n body.parse(tokens, parse_context) do |end_tag_name, end_tag_params|\n @blank &&= body.blank?\n\n return false if end_tag_name == block_delimiter\n raise_tag_never_closed(block_name) unless end_tag_name\n\n # this tag is not registered with the system\n # pass it to the current block for special handling or error reporting\n unknown_tag(end_tag_name, end_tag_params, tokens)\n end\n ensure\n parse_context.depth -= 1\n end\n\n true\nend", + "signature": "def parse_body(body, tokens)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "api", + "text": "public", + "types": null, + "name": null + } + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "body", + null + ], + [ + "tokens", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "tag_name", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def tag_name\n @tag_name\nend", + "signature": "def tag_name", + "docstring": "Returns the value of attribute tag_name.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "line_number", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def line_number\n @line_number\nend", + "signature": "def line_number", + "docstring": "Returns the value of attribute line_number.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_context", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def parse_context\n @parse_context\nend", + "signature": "def parse_context", + "docstring": "Returns the value of attribute parse_context.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + "Liquid::Tag#options" + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "options", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 6 + ] + ], + "source": "def parse_context\n @parse_context\nend", + "signature": "def parse_context", + "docstring": "Returns the value of attribute parse_context.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 10 + ] + ], + "source": "def parse(tag_name, markup, tokenizer, parse_context)\n tag = new(tag_name, markup, parse_context)\n tag.parse(tokenizer)\n tag\nend", + "signature": "def parse(tag_name, markup, tokenizer, parse_context)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "tag_name", + null + ], + [ + "markup", + null + ], + [ + "tokenizer", + null + ], + [ + "parse_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "disable_tags", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 16 + ] + ], + "source": "def disable_tags(*tag_names)\n @disabled_tags ||= []\n @disabled_tags.concat(tag_names)\n prepend(Disabler)\nend", + "signature": "def disable_tags(*tag_names)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "*tag_names", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "raw", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 35 + ] + ], + "source": "def raw\n \"#{@tag_name} #{@markup}\"\nend", + "signature": "def raw", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "name", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 39 + ] + ], + "source": "def name\n self.class.name.downcase\nend", + "signature": "def name", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "strict_parse_with_error_mode_fallback", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 5 + ] + ], + "source": "def strict_parse_with_error_mode_fallback(markup)\n strict_parse_with_error_context(markup)\nrescue SyntaxError => e\n case parse_context.error_mode\n when :strict\n raise\n when :warn\n parse_context.warnings << e\n end\n lax_parse(markup)\nend", + "signature": "def strict_parse_with_error_mode_fallback(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_with_selected_parser", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 17 + ] + ], + "source": "def parse_with_selected_parser(markup)\n case parse_context.error_mode\n when :strict then strict_parse_with_error_context(markup)\n when :lax then lax_parse(markup)\n when :warn\n begin\n strict_parse_with_error_context(markup)\n rescue SyntaxError => e\n parse_context.warnings << e\n lax_parse(markup)\n end\n end\nend", + "signature": "def parse_with_selected_parser(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "strict_parse_with_error_context", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 33 + ] + ], + "source": "def strict_parse_with_error_context(markup)\n strict_parse(markup)\nrescue SyntaxError => e\n e.line_number = line_number\n e.markup_context = markup_context(markup)\n raise e\nend", + "signature": "def strict_parse_with_error_context(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "markup_context", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 41 + ] + ], + "source": "def markup_context(markup)\n \"in \\\"#{markup.strip}\\\"\"\nend", + "signature": "def markup_context(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + } + ], + "constants": [ + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "Syntax", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "If", + "files": [ + [ + "lib/liquid/tags/if.rb", + 15 + ] + ], + "source": "Syntax = /(#{QuotedFragment})\\s*([=!<>a-z_]+)?\\s*(#{QuotedFragment})?/o", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "/(#{QuotedFragment})\\s*([=!<>a-z_]+)?\\s*(#{QuotedFragment})?/o" + }, + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "ExpressionsAndOperators", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "If", + "files": [ + [ + "lib/liquid/tags/if.rb", + 16 + ] + ], + "source": "ExpressionsAndOperators = /(?:\\b(?:\\s?and\\s?|\\s?or\\s?)\\b|(?:\\s*(?!\\b(?:\\s?and\\s?|\\s?or\\s?)\\b)(?:#{QuotedFragment}|\\S+)\\s*)+)/o", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "/(?:\\b(?:\\s?and\\s?|\\s?or\\s?)\\b|(?:\\s*(?!\\b(?:\\s?and\\s?|\\s?or\\s?)\\b)(?:#{QuotedFragment}|\\S+)\\s*)+)/o" + }, + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "BOOLEAN_OPERATORS", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "If", + "files": [ + [ + "lib/liquid/tags/if.rb", + 17 + ] + ], + "source": "BOOLEAN_OPERATORS = %w(and or).freeze", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "%w(and or).freeze" + }, + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "ELSE_TAG_NAMES", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "If", + "files": [ + [ + "lib/liquid/tags/if.rb", + 40 + ] + ], + "source": "ELSE_TAG_NAMES = ['elsif', 'else'].freeze", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "['elsif', 'else'].freeze" + }, + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "MAX_DEPTH", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 5 + ] + ], + "source": "MAX_DEPTH = 100", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "100" + } + ], + "instance_attributes": { + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "ForloopDrop", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/forloop_drop.rb", + 4 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "initialize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ForloopDrop", + "files": [ + [ + "lib/liquid/forloop_drop.rb", + 5 + ] + ], + "source": "def initialize(name, length, parentloop)\n @name = name\n @length = length\n @parentloop = parentloop\n @index = 0\nend", + "signature": "def initialize(name, length, parentloop)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "a new instance of ForloopDrop", + "types": [ + "ForloopDrop" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "name", + null + ], + [ + "length", + null + ], + [ + "parentloop", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "length", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ForloopDrop", + "files": [ + [ + "lib/liquid/forloop_drop.rb", + 12 + ] + ], + "source": "def length\n @length\nend", + "signature": "def length", + "docstring": "Returns the value of attribute length.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parentloop", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ForloopDrop", + "files": [ + [ + "lib/liquid/forloop_drop.rb", + 12 + ] + ], + "source": "def parentloop\n @parentloop\nend", + "signature": "def parentloop", + "docstring": "Returns the value of attribute parentloop.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "name", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ForloopDrop", + "files": [ + [ + "lib/liquid/forloop_drop.rb", + 14 + ] + ], + "source": "def name\n Usage.increment('forloop_drop_name')\n @name\nend", + "signature": "def name", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "index", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ForloopDrop", + "files": [ + [ + "lib/liquid/forloop_drop.rb", + 19 + ] + ], + "source": "def index\n @index + 1\nend", + "signature": "def index", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "index0", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ForloopDrop", + "files": [ + [ + "lib/liquid/forloop_drop.rb", + 23 + ] + ], + "source": "def index0\n @index\nend", + "signature": "def index0", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "rindex", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ForloopDrop", + "files": [ + [ + "lib/liquid/forloop_drop.rb", + 27 + ] + ], + "source": "def rindex\n @length - @index\nend", + "signature": "def rindex", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "rindex0", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ForloopDrop", + "files": [ + [ + "lib/liquid/forloop_drop.rb", + 31 + ] + ], + "source": "def rindex0\n @length - @index - 1\nend", + "signature": "def rindex0", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "first", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ForloopDrop", + "files": [ + [ + "lib/liquid/forloop_drop.rb", + 35 + ] + ], + "source": "def first\n @index == 0\nend", + "signature": "def first", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "last", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ForloopDrop", + "files": [ + [ + "lib/liquid/forloop_drop.rb", + 39 + ] + ], + "source": "def last\n @index == @length - 1\nend", + "signature": "def last", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "increment!", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ForloopDrop", + "files": [ + [ + "lib/liquid/forloop_drop.rb", + 45 + ] + ], + "source": "def increment!\n @index += 1\nend", + "signature": "def increment!", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "protected", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "context=", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Drop", + "files": [ + [ + "lib/liquid/drop.rb", + 26 + ] + ], + "source": "def context=(value)\n @context = value\nend", + "signature": "def context=(value)", + "docstring": "Sets the attribute context", + "dynamic": true, + "tags": [ + { + "tag_name": "param", + "text": "the value to set the attribute context to.", + "types": null, + "name": "value" + } + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + [ + "value", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "liquid_method_missing", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Drop", + "files": [ + [ + "lib/liquid/drop.rb", + 29 + ] + ], + "source": "def liquid_method_missing(method)\n return nil unless @context&.strict_variables\n raise Liquid::UndefinedDropMethod, \"undefined method #{method}\"\nend", + "signature": "def liquid_method_missing(method)", + "docstring": "Catch all for the method", + "dynamic": true, + "tags": [ + { + "tag_name": "raise", + "text": "", + "types": [ + "Liquid::UndefinedDropMethod" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "method", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "invoke_drop", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Drop", + "files": [ + [ + "lib/liquid/drop.rb", + 35 + ] + ], + "source": "def invoke_drop(method_or_key)\n if self.class.invokable?(method_or_key)\n send(method_or_key)\n else\n liquid_method_missing(method_or_key)\n end\nend", + "signature": "def invoke_drop(method_or_key)", + "docstring": "called by liquid to invoke a drop", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "method_or_key", + null + ] + ], + "aliases": [ + "Liquid::Drop#[]" + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "key?", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Drop", + "files": [ + [ + "lib/liquid/drop.rb", + 43 + ] + ], + "source": "def key?(_name)\n true\nend", + "signature": "def key?(_name)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "", + "types": [ + "Boolean" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "_name", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "inspect", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Drop", + "files": [ + [ + "lib/liquid/drop.rb", + 47 + ] + ], + "source": "def inspect\n self.class.to_s\nend", + "signature": "def inspect", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "to_liquid", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Drop", + "files": [ + [ + "lib/liquid/drop.rb", + 51 + ] + ], + "source": "def to_liquid\n self\nend", + "signature": "def to_liquid", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "to_s", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Drop", + "files": [ + [ + "lib/liquid/drop.rb", + 55 + ] + ], + "source": "def to_s\n self.class.name\nend", + "signature": "def to_s", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "[]", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Drop", + "files": [ + [ + "lib/liquid/drop.rb", + 59 + ] + ], + "source": "def invoke_drop(method_or_key)\n if self.class.invokable?(method_or_key)\n send(method_or_key)\n else\n liquid_method_missing(method_or_key)\n end\nend", + "signature": "def invoke_drop(method_or_key)", + "docstring": "called by liquid to invoke a drop", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "invokable?", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Drop", + "files": [ + [ + "lib/liquid/drop.rb", + 62 + ] + ], + "source": "def self.invokable?(method_name)\n invokable_methods.include?(method_name.to_s)\nend", + "signature": "def invokable?(method_name)", + "docstring": "Check for method existence without invoking respond_to?, which creates symbols", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "", + "types": [ + "Boolean" + ], + "name": null + } + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "method_name", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "invokable_methods", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Drop", + "files": [ + [ + "lib/liquid/drop.rb", + 66 + ] + ], + "source": "def self.invokable_methods\n @invokable_methods ||= begin\n blacklist = Liquid::Drop.public_instance_methods + [:each]\n\n if include?(Enumerable)\n blacklist += Enumerable.public_instance_methods\n blacklist -= [:sort, :count, :first, :min, :max]\n end\n\n whitelist = [:to_liquid] + (public_instance_methods - blacklist)\n Set.new(whitelist.map(&:to_s))\n end\nend", + "signature": "def invokable_methods", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + } + ], + "constants": [ + + ], + "instance_attributes": { + "length": { + "read": "Liquid::ForloopDrop#length", + "write": null + }, + "parentloop": { + "read": "Liquid::ForloopDrop#parentloop", + "write": null + } + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "RangeLookup", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/range_lookup.rb", + 4 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "RangeLookup", + "files": [ + [ + "lib/liquid/range_lookup.rb", + 5 + ] + ], + "source": "def self.parse(start_markup, end_markup)\n start_obj = Expression.parse(start_markup)\n end_obj = Expression.parse(end_markup)\n if start_obj.respond_to?(:evaluate) || end_obj.respond_to?(:evaluate)\n new(start_obj, end_obj)\n else\n start_obj.to_i..end_obj.to_i\n end\nend", + "signature": "def parse(start_markup, end_markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "start_markup", + null + ], + [ + "end_markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "start_obj", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "RangeLookup", + "files": [ + [ + "lib/liquid/range_lookup.rb", + 15 + ] + ], + "source": "def start_obj\n @start_obj\nend", + "signature": "def start_obj", + "docstring": "Returns the value of attribute start_obj.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "end_obj", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "RangeLookup", + "files": [ + [ + "lib/liquid/range_lookup.rb", + 15 + ] + ], + "source": "def end_obj\n @end_obj\nend", + "signature": "def end_obj", + "docstring": "Returns the value of attribute end_obj.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "initialize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "RangeLookup", + "files": [ + [ + "lib/liquid/range_lookup.rb", + 17 + ] + ], + "source": "def initialize(start_obj, end_obj)\n @start_obj = start_obj\n @end_obj = end_obj\nend", + "signature": "def initialize(start_obj, end_obj)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "a new instance of RangeLookup", + "types": [ + "RangeLookup" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "start_obj", + null + ], + [ + "end_obj", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "evaluate", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "RangeLookup", + "files": [ + [ + "lib/liquid/range_lookup.rb", + 22 + ] + ], + "source": "def evaluate(context)\n start_int = to_integer(context.evaluate(@start_obj))\n end_int = to_integer(context.evaluate(@end_obj))\n start_int..end_int\nend", + "signature": "def evaluate(context)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "to_integer", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "RangeLookup", + "files": [ + [ + "lib/liquid/range_lookup.rb", + 30 + ] + ], + "source": "def to_integer(input)\n case input\n when Integer\n input\n when NilClass, String\n input.to_i\n else\n Utils.to_integer(input)\n end\nend", + "signature": "def to_integer(input)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "input", + null + ] + ], + "aliases": [ + + ] + } + ], + "constants": [ + + ], + "instance_attributes": { + "start_obj": { + "read": "Liquid::RangeLookup#start_obj", + "write": null + }, + "end_obj": { + "read": "Liquid::RangeLookup#end_obj", + "write": null + } + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "ParseTreeVisitor", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "RangeLookup", + "files": [ + [ + "lib/liquid/range_lookup.rb", + 41 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "children", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/range_lookup.rb", + 42 + ] + ], + "source": "def children\n [@node.start_obj, @node.end_obj]\nend", + "signature": "def children", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "for", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/parse_tree_visitor.rb", + 5 + ] + ], + "source": "def self.for(node, callbacks = Hash.new(proc {}))\n if defined?(node.class::ParseTreeVisitor)\n node.class::ParseTreeVisitor\n else\n self\n end.new(node, callbacks)\nend", + "signature": "def for(node, callbacks = Hash.new(proc {}))", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "node", + null + ], + [ + "callbacks", + "Hash.new(proc {})" + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "initialize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/parse_tree_visitor.rb", + 13 + ] + ], + "source": "def initialize(node, callbacks)\n @node = node\n @callbacks = callbacks\nend", + "signature": "def initialize(node, callbacks)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "a new instance of ParseTreeVisitor", + "types": [ + "ParseTreeVisitor" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "node", + null + ], + [ + "callbacks", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "add_callback_for", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/parse_tree_visitor.rb", + 18 + ] + ], + "source": "def add_callback_for(*classes, &block)\n callback = block\n callback = ->(node, _) { yield node } if block.arity.abs == 1\n callback = ->(_, _) { yield } if block.arity.zero?\n classes.each { |klass| @callbacks[klass] = callback }\n self\nend", + "signature": "def add_callback_for(*classes, &block)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "*classes", + null + ], + [ + "&block", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "visit", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/parse_tree_visitor.rb", + 26 + ] + ], + "source": "def visit(context = nil)\n children.map do |node|\n item, new_context = @callbacks[node.class].call(node, context)\n [\n item,\n ParseTreeVisitor.for(node, @callbacks).visit(new_context || context),\n ]\n end\nend", + "signature": "def visit(context = nil)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "context", + "nil" + ] + ], + "aliases": [ + + ] + } + ], + "constants": [ + + ], + "instance_attributes": { + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "Capture", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/tags/capture.rb", + 15 + ] + ], + "source": null, + "signature": null, + "docstring": "Capture stores the result of a block into a variable without rendering it inplace.\n\n {% capture heading %}\n Monkeys!\n {% endcapture %}\n ...\n

{{ heading }}

\n\nCapture is useful for saving content for use later in your template, such as\nin a sidebar or footer.", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "initialize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Capture", + "files": [ + [ + "lib/liquid/tags/capture.rb", + 18 + ] + ], + "source": "def initialize(tag_name, markup, options)\n super\n if markup =~ Syntax\n @to = Regexp.last_match(1)\n else\n raise SyntaxError, options[:locale].t(\"errors.syntax.capture\")\n end\nend", + "signature": "def initialize(tag_name, markup, options)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "a new instance of Capture", + "types": [ + "Capture" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "tag_name", + null + ], + [ + "markup", + null + ], + [ + "options", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "render_to_output_buffer", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Capture", + "files": [ + [ + "lib/liquid/tags/capture.rb", + 27 + ] + ], + "source": "def render_to_output_buffer(context, output)\n context.resource_limits.with_capture do\n capture_output = render(context)\n context.scopes.last[@to] = capture_output\n end\n output\nend", + "signature": "def render_to_output_buffer(context, output)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "context", + null + ], + [ + "output", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "blank?", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Capture", + "files": [ + [ + "lib/liquid/tags/capture.rb", + 35 + ] + ], + "source": "def blank?\n true\nend", + "signature": "def blank?", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "", + "types": [ + "Boolean" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 12 + ] + ], + "source": "def parse(tokens)\n @body = new_body\n while parse_body(@body, tokens)\n end\n @body.freeze\nend", + "signature": "def parse(tokens)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "tokens", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "render", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 20 + ] + ], + "source": "def render(context)\n @body.render(context)\nend", + "signature": "def render(context)", + "docstring": "For backwards compatibility", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "nodelist", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 28 + ] + ], + "source": "def nodelist\n @body.nodelist\nend", + "signature": "def nodelist", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "unknown_tag", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 32 + ] + ], + "source": "def unknown_tag(tag_name, _markup, _tokenizer)\n Block.raise_unknown_tag(tag_name, block_name, block_delimiter, parse_context)\nend", + "signature": "def unknown_tag(tag_name, _markup, _tokenizer)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "tag_name", + null + ], + [ + "_markup", + null + ], + [ + "_tokenizer", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "raise_unknown_tag", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 37 + ] + ], + "source": "def self.raise_unknown_tag(tag, block_name, block_delimiter, parse_context)\n if tag == 'else'\n raise SyntaxError, parse_context.locale.t(\"errors.syntax.unexpected_else\",\n block_name: block_name)\n elsif tag.start_with?('end')\n raise SyntaxError, parse_context.locale.t(\"errors.syntax.invalid_delimiter\",\n tag: tag,\n block_name: block_name,\n block_delimiter: block_delimiter)\n else\n raise SyntaxError, parse_context.locale.t(\"errors.syntax.unknown_tag\", tag: tag)\n end\nend", + "signature": "def raise_unknown_tag(tag, block_name, block_delimiter, parse_context)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "api", + "text": "private", + "types": null, + "name": null + } + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "tag", + null + ], + [ + "block_name", + null + ], + [ + "block_delimiter", + null + ], + [ + "parse_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "raise_tag_never_closed", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 51 + ] + ], + "source": "def raise_tag_never_closed(block_name)\n raise SyntaxError, parse_context.locale.t(\"errors.syntax.tag_never_closed\", block_name: block_name)\nend", + "signature": "def raise_tag_never_closed(block_name)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "raise", + "text": "", + "types": [ + "SyntaxError" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "block_name", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "block_name", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 55 + ] + ], + "source": "def block_name\n @tag_name\nend", + "signature": "def block_name", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "block_delimiter", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 59 + ] + ], + "source": "def block_delimiter\n @block_delimiter ||= \"end#{block_name}\"\nend", + "signature": "def block_delimiter", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "new_body", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 66 + ] + ], + "source": "def new_body\n parse_context.new_block_body\nend", + "signature": "def new_body", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "api", + "text": "public", + "types": null, + "name": null + } + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_body", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 71 + ] + ], + "source": "def parse_body(body, tokens)\n if parse_context.depth >= MAX_DEPTH\n raise StackLevelError, \"Nesting too deep\"\n end\n parse_context.depth += 1\n begin\n body.parse(tokens, parse_context) do |end_tag_name, end_tag_params|\n @blank &&= body.blank?\n\n return false if end_tag_name == block_delimiter\n raise_tag_never_closed(block_name) unless end_tag_name\n\n # this tag is not registered with the system\n # pass it to the current block for special handling or error reporting\n unknown_tag(end_tag_name, end_tag_params, tokens)\n end\n ensure\n parse_context.depth -= 1\n end\n\n true\nend", + "signature": "def parse_body(body, tokens)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "api", + "text": "public", + "types": null, + "name": null + } + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "body", + null + ], + [ + "tokens", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "tag_name", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def tag_name\n @tag_name\nend", + "signature": "def tag_name", + "docstring": "Returns the value of attribute tag_name.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "line_number", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def line_number\n @line_number\nend", + "signature": "def line_number", + "docstring": "Returns the value of attribute line_number.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_context", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def parse_context\n @parse_context\nend", + "signature": "def parse_context", + "docstring": "Returns the value of attribute parse_context.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + "Liquid::Tag#options" + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "options", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 6 + ] + ], + "source": "def parse_context\n @parse_context\nend", + "signature": "def parse_context", + "docstring": "Returns the value of attribute parse_context.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 10 + ] + ], + "source": "def parse(tag_name, markup, tokenizer, parse_context)\n tag = new(tag_name, markup, parse_context)\n tag.parse(tokenizer)\n tag\nend", + "signature": "def parse(tag_name, markup, tokenizer, parse_context)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "tag_name", + null + ], + [ + "markup", + null + ], + [ + "tokenizer", + null + ], + [ + "parse_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "disable_tags", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 16 + ] + ], + "source": "def disable_tags(*tag_names)\n @disabled_tags ||= []\n @disabled_tags.concat(tag_names)\n prepend(Disabler)\nend", + "signature": "def disable_tags(*tag_names)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "*tag_names", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "raw", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 35 + ] + ], + "source": "def raw\n \"#{@tag_name} #{@markup}\"\nend", + "signature": "def raw", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "name", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 39 + ] + ], + "source": "def name\n self.class.name.downcase\nend", + "signature": "def name", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_expression", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 61 + ] + ], + "source": "def parse_expression(markup)\n parse_context.parse_expression(markup)\nend", + "signature": "def parse_expression(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "strict_parse_with_error_mode_fallback", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 5 + ] + ], + "source": "def strict_parse_with_error_mode_fallback(markup)\n strict_parse_with_error_context(markup)\nrescue SyntaxError => e\n case parse_context.error_mode\n when :strict\n raise\n when :warn\n parse_context.warnings << e\n end\n lax_parse(markup)\nend", + "signature": "def strict_parse_with_error_mode_fallback(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_with_selected_parser", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 17 + ] + ], + "source": "def parse_with_selected_parser(markup)\n case parse_context.error_mode\n when :strict then strict_parse_with_error_context(markup)\n when :lax then lax_parse(markup)\n when :warn\n begin\n strict_parse_with_error_context(markup)\n rescue SyntaxError => e\n parse_context.warnings << e\n lax_parse(markup)\n end\n end\nend", + "signature": "def parse_with_selected_parser(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "strict_parse_with_error_context", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 33 + ] + ], + "source": "def strict_parse_with_error_context(markup)\n strict_parse(markup)\nrescue SyntaxError => e\n e.line_number = line_number\n e.markup_context = markup_context(markup)\n raise e\nend", + "signature": "def strict_parse_with_error_context(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "markup_context", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 41 + ] + ], + "source": "def markup_context(markup)\n \"in \\\"#{markup.strip}\\\"\"\nend", + "signature": "def markup_context(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + } + ], + "constants": [ + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "Syntax", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Capture", + "files": [ + [ + "lib/liquid/tags/capture.rb", + 16 + ] + ], + "source": "Syntax = /(#{VariableSignature}+)/o", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "/(#{VariableSignature}+)/o" + }, + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "MAX_DEPTH", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 5 + ] + ], + "source": "MAX_DEPTH = 100", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "100" + } + ], + "instance_attributes": { + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "Comment", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/tags/comment.rb", + 4 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "render_to_output_buffer", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Comment", + "files": [ + [ + "lib/liquid/tags/comment.rb", + 5 + ] + ], + "source": "def render_to_output_buffer(_context, output)\n output\nend", + "signature": "def render_to_output_buffer(_context, output)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "_context", + null + ], + [ + "output", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "unknown_tag", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Comment", + "files": [ + [ + "lib/liquid/tags/comment.rb", + 9 + ] + ], + "source": "def unknown_tag(_tag, _markup, _tokens)\nend", + "signature": "def unknown_tag(_tag, _markup, _tokens)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "_tag", + null + ], + [ + "_markup", + null + ], + [ + "_tokens", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "blank?", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Comment", + "files": [ + [ + "lib/liquid/tags/comment.rb", + 12 + ] + ], + "source": "def blank?\n true\nend", + "signature": "def blank?", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "", + "types": [ + "Boolean" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "initialize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 7 + ] + ], + "source": "def initialize(tag_name, markup, options)\n super\n @blank = true\nend", + "signature": "def initialize(tag_name, markup, options)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "a new instance of Block", + "types": [ + "Block" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "tag_name", + null + ], + [ + "markup", + null + ], + [ + "options", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 12 + ] + ], + "source": "def parse(tokens)\n @body = new_body\n while parse_body(@body, tokens)\n end\n @body.freeze\nend", + "signature": "def parse(tokens)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "tokens", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "render", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 20 + ] + ], + "source": "def render(context)\n @body.render(context)\nend", + "signature": "def render(context)", + "docstring": "For backwards compatibility", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "nodelist", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 28 + ] + ], + "source": "def nodelist\n @body.nodelist\nend", + "signature": "def nodelist", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "raise_unknown_tag", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 37 + ] + ], + "source": "def self.raise_unknown_tag(tag, block_name, block_delimiter, parse_context)\n if tag == 'else'\n raise SyntaxError, parse_context.locale.t(\"errors.syntax.unexpected_else\",\n block_name: block_name)\n elsif tag.start_with?('end')\n raise SyntaxError, parse_context.locale.t(\"errors.syntax.invalid_delimiter\",\n tag: tag,\n block_name: block_name,\n block_delimiter: block_delimiter)\n else\n raise SyntaxError, parse_context.locale.t(\"errors.syntax.unknown_tag\", tag: tag)\n end\nend", + "signature": "def raise_unknown_tag(tag, block_name, block_delimiter, parse_context)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "api", + "text": "private", + "types": null, + "name": null + } + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "tag", + null + ], + [ + "block_name", + null + ], + [ + "block_delimiter", + null + ], + [ + "parse_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "raise_tag_never_closed", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 51 + ] + ], + "source": "def raise_tag_never_closed(block_name)\n raise SyntaxError, parse_context.locale.t(\"errors.syntax.tag_never_closed\", block_name: block_name)\nend", + "signature": "def raise_tag_never_closed(block_name)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "raise", + "text": "", + "types": [ + "SyntaxError" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "block_name", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "block_name", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 55 + ] + ], + "source": "def block_name\n @tag_name\nend", + "signature": "def block_name", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "block_delimiter", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 59 + ] + ], + "source": "def block_delimiter\n @block_delimiter ||= \"end#{block_name}\"\nend", + "signature": "def block_delimiter", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "new_body", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 66 + ] + ], + "source": "def new_body\n parse_context.new_block_body\nend", + "signature": "def new_body", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "api", + "text": "public", + "types": null, + "name": null + } + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_body", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 71 + ] + ], + "source": "def parse_body(body, tokens)\n if parse_context.depth >= MAX_DEPTH\n raise StackLevelError, \"Nesting too deep\"\n end\n parse_context.depth += 1\n begin\n body.parse(tokens, parse_context) do |end_tag_name, end_tag_params|\n @blank &&= body.blank?\n\n return false if end_tag_name == block_delimiter\n raise_tag_never_closed(block_name) unless end_tag_name\n\n # this tag is not registered with the system\n # pass it to the current block for special handling or error reporting\n unknown_tag(end_tag_name, end_tag_params, tokens)\n end\n ensure\n parse_context.depth -= 1\n end\n\n true\nend", + "signature": "def parse_body(body, tokens)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "api", + "text": "public", + "types": null, + "name": null + } + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "body", + null + ], + [ + "tokens", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "tag_name", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def tag_name\n @tag_name\nend", + "signature": "def tag_name", + "docstring": "Returns the value of attribute tag_name.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "line_number", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def line_number\n @line_number\nend", + "signature": "def line_number", + "docstring": "Returns the value of attribute line_number.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_context", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def parse_context\n @parse_context\nend", + "signature": "def parse_context", + "docstring": "Returns the value of attribute parse_context.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + "Liquid::Tag#options" + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "options", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 6 + ] + ], + "source": "def parse_context\n @parse_context\nend", + "signature": "def parse_context", + "docstring": "Returns the value of attribute parse_context.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 10 + ] + ], + "source": "def parse(tag_name, markup, tokenizer, parse_context)\n tag = new(tag_name, markup, parse_context)\n tag.parse(tokenizer)\n tag\nend", + "signature": "def parse(tag_name, markup, tokenizer, parse_context)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "tag_name", + null + ], + [ + "markup", + null + ], + [ + "tokenizer", + null + ], + [ + "parse_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "disable_tags", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 16 + ] + ], + "source": "def disable_tags(*tag_names)\n @disabled_tags ||= []\n @disabled_tags.concat(tag_names)\n prepend(Disabler)\nend", + "signature": "def disable_tags(*tag_names)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "*tag_names", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "raw", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 35 + ] + ], + "source": "def raw\n \"#{@tag_name} #{@markup}\"\nend", + "signature": "def raw", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "name", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 39 + ] + ], + "source": "def name\n self.class.name.downcase\nend", + "signature": "def name", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_expression", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 61 + ] + ], + "source": "def parse_expression(markup)\n parse_context.parse_expression(markup)\nend", + "signature": "def parse_expression(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "strict_parse_with_error_mode_fallback", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 5 + ] + ], + "source": "def strict_parse_with_error_mode_fallback(markup)\n strict_parse_with_error_context(markup)\nrescue SyntaxError => e\n case parse_context.error_mode\n when :strict\n raise\n when :warn\n parse_context.warnings << e\n end\n lax_parse(markup)\nend", + "signature": "def strict_parse_with_error_mode_fallback(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_with_selected_parser", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 17 + ] + ], + "source": "def parse_with_selected_parser(markup)\n case parse_context.error_mode\n when :strict then strict_parse_with_error_context(markup)\n when :lax then lax_parse(markup)\n when :warn\n begin\n strict_parse_with_error_context(markup)\n rescue SyntaxError => e\n parse_context.warnings << e\n lax_parse(markup)\n end\n end\nend", + "signature": "def parse_with_selected_parser(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "strict_parse_with_error_context", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 33 + ] + ], + "source": "def strict_parse_with_error_context(markup)\n strict_parse(markup)\nrescue SyntaxError => e\n e.line_number = line_number\n e.markup_context = markup_context(markup)\n raise e\nend", + "signature": "def strict_parse_with_error_context(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "markup_context", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 41 + ] + ], + "source": "def markup_context(markup)\n \"in \\\"#{markup.strip}\\\"\"\nend", + "signature": "def markup_context(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + } + ], + "constants": [ + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "MAX_DEPTH", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 5 + ] + ], + "source": "MAX_DEPTH = 100", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "100" + } + ], + "instance_attributes": { + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "Include", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/tags/include.rb", + 18 + ] + ], + "source": null, + "signature": null, + "docstring": "Include allows templates to relate with other templates\n\nSimply include another template:\n\n {% include 'product' %}\n\nInclude a template with a local variable:\n\n {% include 'product' with products[0] %}\n\nInclude a template for a collection:\n\n {% include 'product' for products %}", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "template_name_expr", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Include", + "files": [ + [ + "lib/liquid/tags/include.rb", + 24 + ] + ], + "source": "def template_name_expr\n @template_name_expr\nend", + "signature": "def template_name_expr", + "docstring": "Returns the value of attribute template_name_expr.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "variable_name_expr", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Include", + "files": [ + [ + "lib/liquid/tags/include.rb", + 24 + ] + ], + "source": "def variable_name_expr\n @variable_name_expr\nend", + "signature": "def variable_name_expr", + "docstring": "Returns the value of attribute variable_name_expr.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "attributes", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Include", + "files": [ + [ + "lib/liquid/tags/include.rb", + 24 + ] + ], + "source": "def attributes\n @attributes\nend", + "signature": "def attributes", + "docstring": "Returns the value of attribute attributes.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "initialize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Include", + "files": [ + [ + "lib/liquid/tags/include.rb", + 26 + ] + ], + "source": "def initialize(tag_name, markup, options)\n super\n\n if markup =~ SYNTAX\n\n template_name = Regexp.last_match(1)\n variable_name = Regexp.last_match(3)\n\n @alias_name = Regexp.last_match(5)\n @variable_name_expr = variable_name ? parse_expression(variable_name) : nil\n @template_name_expr = parse_expression(template_name)\n @attributes = {}\n\n markup.scan(TagAttributes) do |key, value|\n @attributes[key] = parse_expression(value)\n end\n\n else\n raise SyntaxError, options[:locale].t(\"errors.syntax.include\")\n end\nend", + "signature": "def initialize(tag_name, markup, options)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "a new instance of Include", + "types": [ + "Include" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "tag_name", + null + ], + [ + "markup", + null + ], + [ + "options", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Include", + "files": [ + [ + "lib/liquid/tags/include.rb", + 48 + ] + ], + "source": "def parse(_tokens)\nend", + "signature": "def parse(_tokens)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "_tokens", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "render_to_output_buffer", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Include", + "files": [ + [ + "lib/liquid/tags/include.rb", + 51 + ] + ], + "source": "def render_to_output_buffer(context, output)\n template_name = context.evaluate(@template_name_expr)\n raise ArgumentError, options[:locale].t(\"errors.argument.include\") unless template_name\n\n partial = PartialCache.load(\n template_name,\n context: context,\n parse_context: parse_context\n )\n\n context_variable_name = @alias_name || template_name.split('/').last\n\n variable = if @variable_name_expr\n context.evaluate(@variable_name_expr)\n else\n context.find_variable(template_name, raise_on_not_found: false)\n end\n\n old_template_name = context.template_name\n old_partial = context.partial\n begin\n context.template_name = template_name\n context.partial = true\n context.stack do\n @attributes.each do |key, value|\n context[key] = context.evaluate(value)\n end\n\n if variable.is_a?(Array)\n variable.each do |var|\n context[context_variable_name] = var\n partial.render_to_output_buffer(context, output)\n end\n else\n context[context_variable_name] = variable\n partial.render_to_output_buffer(context, output)\n end\n end\n ensure\n context.template_name = old_template_name\n context.partial = old_partial\n end\n\n output\nend", + "signature": "def render_to_output_buffer(context, output)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "raise", + "text": "", + "types": [ + "ArgumentError" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "context", + null + ], + [ + "output", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_context", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Include", + "files": [ + [ + "lib/liquid/tags/include.rb", + 97 + ] + ], + "source": "alias_method :parse_context, :options", + "signature": "def parse_context", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "disabled_error", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Disableable", + "files": [ + [ + "lib/liquid/tag/disableable.rb", + 14 + ] + ], + "source": "def disabled_error(context)\n # raise then rescue the exception so that the Context#exception_renderer can re-raise it\n raise DisabledError, \"#{tag_name} #{parse_context[:locale].t('errors.disabled.tag')}\"\nrescue DisabledError => exc\n context.handle_error(exc, line_number)\nend", + "signature": "def disabled_error(context)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "nodelist", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def nodelist\n @nodelist\nend", + "signature": "def nodelist", + "docstring": "Returns the value of attribute nodelist.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "tag_name", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def tag_name\n @tag_name\nend", + "signature": "def tag_name", + "docstring": "Returns the value of attribute tag_name.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "line_number", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def line_number\n @line_number\nend", + "signature": "def line_number", + "docstring": "Returns the value of attribute line_number.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "options", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 6 + ] + ], + "source": "def parse_context\n @parse_context\nend", + "signature": "def parse_context", + "docstring": "Returns the value of attribute parse_context.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 10 + ] + ], + "source": "def parse(tag_name, markup, tokenizer, parse_context)\n tag = new(tag_name, markup, parse_context)\n tag.parse(tokenizer)\n tag\nend", + "signature": "def parse(tag_name, markup, tokenizer, parse_context)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "tag_name", + null + ], + [ + "markup", + null + ], + [ + "tokenizer", + null + ], + [ + "parse_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "disable_tags", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 16 + ] + ], + "source": "def disable_tags(*tag_names)\n @disabled_tags ||= []\n @disabled_tags.concat(tag_names)\n prepend(Disabler)\nend", + "signature": "def disable_tags(*tag_names)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "*tag_names", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "raw", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 35 + ] + ], + "source": "def raw\n \"#{@tag_name} #{@markup}\"\nend", + "signature": "def raw", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "name", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 39 + ] + ], + "source": "def name\n self.class.name.downcase\nend", + "signature": "def name", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "render", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 43 + ] + ], + "source": "def render(_context)\n ''\nend", + "signature": "def render(_context)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "blank?", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 55 + ] + ], + "source": "def blank?\n false\nend", + "signature": "def blank?", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "", + "types": [ + "Boolean" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_expression", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 61 + ] + ], + "source": "def parse_expression(markup)\n parse_context.parse_expression(markup)\nend", + "signature": "def parse_expression(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "strict_parse_with_error_mode_fallback", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 5 + ] + ], + "source": "def strict_parse_with_error_mode_fallback(markup)\n strict_parse_with_error_context(markup)\nrescue SyntaxError => e\n case parse_context.error_mode\n when :strict\n raise\n when :warn\n parse_context.warnings << e\n end\n lax_parse(markup)\nend", + "signature": "def strict_parse_with_error_mode_fallback(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_with_selected_parser", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 17 + ] + ], + "source": "def parse_with_selected_parser(markup)\n case parse_context.error_mode\n when :strict then strict_parse_with_error_context(markup)\n when :lax then lax_parse(markup)\n when :warn\n begin\n strict_parse_with_error_context(markup)\n rescue SyntaxError => e\n parse_context.warnings << e\n lax_parse(markup)\n end\n end\nend", + "signature": "def parse_with_selected_parser(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "strict_parse_with_error_context", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 33 + ] + ], + "source": "def strict_parse_with_error_context(markup)\n strict_parse(markup)\nrescue SyntaxError => e\n e.line_number = line_number\n e.markup_context = markup_context(markup)\n raise e\nend", + "signature": "def strict_parse_with_error_context(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "markup_context", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 41 + ] + ], + "source": "def markup_context(markup)\n \"in \\\"#{markup.strip}\\\"\"\nend", + "signature": "def markup_context(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + } + ], + "constants": [ + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "SYNTAX", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Include", + "files": [ + [ + "lib/liquid/tags/include.rb", + 21 + ] + ], + "source": "SYNTAX = /(#{QuotedFragment}+)(\\s+(?:with|for)\\s+(#{QuotedFragment}+))?(\\s+(?:as)\\s+(#{VariableSegment}+))?/o", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "/(#{QuotedFragment}+)(\\s+(?:with|for)\\s+(#{QuotedFragment}+))?(\\s+(?:as)\\s+(#{VariableSegment}+))?/o" + }, + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "Syntax", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Include", + "files": [ + [ + "lib/liquid/tags/include.rb", + 22 + ] + ], + "source": "Syntax = SYNTAX", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "SYNTAX" + } + ], + "instance_attributes": { + "template_name_expr": { + "read": "Liquid::Include#template_name_expr", + "write": null + }, + "variable_name_expr": { + "read": "Liquid::Include#variable_name_expr", + "write": null + }, + "attributes": { + "read": "Liquid::Include#attributes", + "write": null + } + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + { + "type": "YARD::CodeObjects::ModuleObject", + "name": "Disableable", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag/disableable.rb", + 5 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ] + } + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "ParseTreeVisitor", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Include", + "files": [ + [ + "lib/liquid/tags/include.rb", + 100 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "children", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/tags/include.rb", + 101 + ] + ], + "source": "def children\n [\n @node.template_name_expr,\n @node.variable_name_expr,\n ] + @node.attributes.values\nend", + "signature": "def children", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "for", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/parse_tree_visitor.rb", + 5 + ] + ], + "source": "def self.for(node, callbacks = Hash.new(proc {}))\n if defined?(node.class::ParseTreeVisitor)\n node.class::ParseTreeVisitor\n else\n self\n end.new(node, callbacks)\nend", + "signature": "def for(node, callbacks = Hash.new(proc {}))", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "node", + null + ], + [ + "callbacks", + "Hash.new(proc {})" + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "initialize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/parse_tree_visitor.rb", + 13 + ] + ], + "source": "def initialize(node, callbacks)\n @node = node\n @callbacks = callbacks\nend", + "signature": "def initialize(node, callbacks)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "a new instance of ParseTreeVisitor", + "types": [ + "ParseTreeVisitor" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "node", + null + ], + [ + "callbacks", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "add_callback_for", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/parse_tree_visitor.rb", + 18 + ] + ], + "source": "def add_callback_for(*classes, &block)\n callback = block\n callback = ->(node, _) { yield node } if block.arity.abs == 1\n callback = ->(_, _) { yield } if block.arity.zero?\n classes.each { |klass| @callbacks[klass] = callback }\n self\nend", + "signature": "def add_callback_for(*classes, &block)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "*classes", + null + ], + [ + "&block", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "visit", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/parse_tree_visitor.rb", + 26 + ] + ], + "source": "def visit(context = nil)\n children.map do |node|\n item, new_context = @callbacks[node.class].call(node, context)\n [\n item,\n ParseTreeVisitor.for(node, @callbacks).visit(new_context || context),\n ]\n end\nend", + "signature": "def visit(context = nil)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "context", + "nil" + ] + ], + "aliases": [ + + ] + } + ], + "constants": [ + + ], + "instance_attributes": { + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "ParseContext", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/parse_context.rb", + 4 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "locale", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseContext", + "files": [ + [ + "lib/liquid/parse_context.rb", + 5 + ] + ], + "source": "def locale\n @locale\nend", + "signature": "def locale", + "docstring": "Returns the value of attribute locale.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "locale=", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseContext", + "files": [ + [ + "lib/liquid/parse_context.rb", + 5 + ] + ], + "source": "def locale=(value)\n @locale = value\nend", + "signature": "def locale=(value)", + "docstring": "Sets the attribute locale", + "dynamic": true, + "tags": [ + { + "tag_name": "param", + "text": "the value to set the attribute locale to.", + "types": null, + "name": "value" + } + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + [ + "value", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "line_number", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseContext", + "files": [ + [ + "lib/liquid/parse_context.rb", + 5 + ] + ], + "source": "def line_number\n @line_number\nend", + "signature": "def line_number", + "docstring": "Returns the value of attribute line_number.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "line_number=", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseContext", + "files": [ + [ + "lib/liquid/parse_context.rb", + 5 + ] + ], + "source": "def line_number=(value)\n @line_number = value\nend", + "signature": "def line_number=(value)", + "docstring": "Sets the attribute line_number", + "dynamic": true, + "tags": [ + { + "tag_name": "param", + "text": "the value to set the attribute line_number to.", + "types": null, + "name": "value" + } + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + [ + "value", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "trim_whitespace", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseContext", + "files": [ + [ + "lib/liquid/parse_context.rb", + 5 + ] + ], + "source": "def trim_whitespace\n @trim_whitespace\nend", + "signature": "def trim_whitespace", + "docstring": "Returns the value of attribute trim_whitespace.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "trim_whitespace=", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseContext", + "files": [ + [ + "lib/liquid/parse_context.rb", + 5 + ] + ], + "source": "def trim_whitespace=(value)\n @trim_whitespace = value\nend", + "signature": "def trim_whitespace=(value)", + "docstring": "Sets the attribute trim_whitespace", + "dynamic": true, + "tags": [ + { + "tag_name": "param", + "text": "the value to set the attribute trim_whitespace to.", + "types": null, + "name": "value" + } + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + [ + "value", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "depth", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseContext", + "files": [ + [ + "lib/liquid/parse_context.rb", + 5 + ] + ], + "source": "def depth\n @depth\nend", + "signature": "def depth", + "docstring": "Returns the value of attribute depth.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "depth=", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseContext", + "files": [ + [ + "lib/liquid/parse_context.rb", + 5 + ] + ], + "source": "def depth=(value)\n @depth = value\nend", + "signature": "def depth=(value)", + "docstring": "Sets the attribute depth", + "dynamic": true, + "tags": [ + { + "tag_name": "param", + "text": "the value to set the attribute depth to.", + "types": null, + "name": "value" + } + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + [ + "value", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "partial", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseContext", + "files": [ + [ + "lib/liquid/parse_context.rb", + 6 + ] + ], + "source": "def partial\n @partial\nend", + "signature": "def partial", + "docstring": "Returns the value of attribute partial.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "warnings", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseContext", + "files": [ + [ + "lib/liquid/parse_context.rb", + 6 + ] + ], + "source": "def warnings\n @warnings\nend", + "signature": "def warnings", + "docstring": "Returns the value of attribute warnings.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "error_mode", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseContext", + "files": [ + [ + "lib/liquid/parse_context.rb", + 6 + ] + ], + "source": "def error_mode\n @error_mode\nend", + "signature": "def error_mode", + "docstring": "Returns the value of attribute error_mode.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "initialize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseContext", + "files": [ + [ + "lib/liquid/parse_context.rb", + 8 + ] + ], + "source": "def initialize(options = {})\n @template_options = options ? options.dup : {}\n\n @locale = @template_options[:locale] ||= I18n.new\n @warnings = []\n\n self.depth = 0\n self.partial = false\nend", + "signature": "def initialize(options = {})", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "a new instance of ParseContext", + "types": [ + "ParseContext" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "options", + "{}" + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "[]", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseContext", + "files": [ + [ + "lib/liquid/parse_context.rb", + 18 + ] + ], + "source": "def [](option_key)\n @options[option_key]\nend", + "signature": "def [](option_key)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "option_key", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "new_block_body", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseContext", + "files": [ + [ + "lib/liquid/parse_context.rb", + 22 + ] + ], + "source": "def new_block_body\n Liquid::BlockBody.new\nend", + "signature": "def new_block_body", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "new_tokenizer", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseContext", + "files": [ + [ + "lib/liquid/parse_context.rb", + 26 + ] + ], + "source": "def new_tokenizer(markup, start_line_number: nil, for_liquid_tag: false)\n Tokenizer.new(markup, line_number: start_line_number, for_liquid_tag: for_liquid_tag)\nend", + "signature": "def new_tokenizer(markup, start_line_number: nil, for_liquid_tag: false)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ], + [ + "start_line_number:", + "nil" + ], + [ + "for_liquid_tag:", + "false" + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_expression", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseContext", + "files": [ + [ + "lib/liquid/parse_context.rb", + 30 + ] + ], + "source": "def parse_expression(markup)\n Expression.parse(markup)\nend", + "signature": "def parse_expression(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "partial=", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseContext", + "files": [ + [ + "lib/liquid/parse_context.rb", + 34 + ] + ], + "source": "def partial=(value)\n @partial = value\n @options = value ? partial_options : @template_options\n\n @error_mode = @options[:error_mode] || Template.error_mode\nend", + "signature": "def partial=(value)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "value", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "partial_options", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseContext", + "files": [ + [ + "lib/liquid/parse_context.rb", + 41 + ] + ], + "source": "def partial_options\n @partial_options ||= begin\n dont_pass = @template_options[:include_options_blacklist]\n if dont_pass == true\n { locale: locale }\n elsif dont_pass.is_a?(Array)\n @template_options.reject { |k, _v| dont_pass.include?(k) }\n else\n @template_options\n end\n end\nend", + "signature": "def partial_options", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + } + ], + "constants": [ + + ], + "instance_attributes": { + "locale": { + "read": "Liquid::ParseContext#locale", + "write": "Liquid::ParseContext#locale=" + }, + "line_number": { + "read": "Liquid::ParseContext#line_number", + "write": "Liquid::ParseContext#line_number=" + }, + "trim_whitespace": { + "read": "Liquid::ParseContext#trim_whitespace", + "write": "Liquid::ParseContext#trim_whitespace=" + }, + "depth": { + "read": "Liquid::ParseContext#depth", + "write": "Liquid::ParseContext#depth=" + }, + "partial": { + "read": "Liquid::ParseContext#partial", + "write": "Liquid::ParseContext#partial=" + }, + "warnings": { + "read": "Liquid::ParseContext#warnings", + "write": null + }, + "error_mode": { + "read": "Liquid::ParseContext#error_mode", + "write": null + } + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "PartialCache", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/partial_cache.rb", + 4 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "load", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "PartialCache", + "files": [ + [ + "lib/liquid/partial_cache.rb", + 5 + ] + ], + "source": "def self.load(template_name, context:, parse_context:)\n cached_partials = (context.registers[:cached_partials] ||= {})\n cached = cached_partials[template_name]\n return cached if cached\n\n file_system = (context.registers[:file_system] ||= Liquid::Template.file_system)\n source = file_system.read_template_file(template_name)\n\n parse_context.partial = true\n\n template_factory = (context.registers[:template_factory] ||= Liquid::TemplateFactory.new)\n template = template_factory.for(template_name)\n\n partial = template.parse(source, parse_context)\n cached_partials[template_name] = partial\nensure\n parse_context.partial = false\nend", + "signature": "def load(template_name, context:, parse_context:)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "template_name", + null + ], + [ + "context:", + null + ], + [ + "parse_context:", + null + ] + ], + "aliases": [ + + ] + } + ], + "constants": [ + + ], + "instance_attributes": { + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "Continue", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/tags/continue.rb", + 13 + ] + ], + "source": null, + "signature": null, + "docstring": "Continue tag to be used to break out of a for loop.\n\n== Basic Usage:\n {% for item in collection %}\n {% if item.condition %}\n {% continue %}\n {% endif %}\n {% endfor %}", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "render_to_output_buffer", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Continue", + "files": [ + [ + "lib/liquid/tags/continue.rb", + 16 + ] + ], + "source": "def render_to_output_buffer(context, output)\n context.push_interrupt(INTERRUPT)\n output\nend", + "signature": "def render_to_output_buffer(context, output)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "context", + null + ], + [ + "output", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "nodelist", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def nodelist\n @nodelist\nend", + "signature": "def nodelist", + "docstring": "Returns the value of attribute nodelist.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "tag_name", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def tag_name\n @tag_name\nend", + "signature": "def tag_name", + "docstring": "Returns the value of attribute tag_name.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "line_number", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def line_number\n @line_number\nend", + "signature": "def line_number", + "docstring": "Returns the value of attribute line_number.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_context", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def parse_context\n @parse_context\nend", + "signature": "def parse_context", + "docstring": "Returns the value of attribute parse_context.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + "Liquid::Tag#options" + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "options", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 6 + ] + ], + "source": "def parse_context\n @parse_context\nend", + "signature": "def parse_context", + "docstring": "Returns the value of attribute parse_context.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 10 + ] + ], + "source": "def parse(tag_name, markup, tokenizer, parse_context)\n tag = new(tag_name, markup, parse_context)\n tag.parse(tokenizer)\n tag\nend", + "signature": "def parse(tag_name, markup, tokenizer, parse_context)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "tag_name", + null + ], + [ + "markup", + null + ], + [ + "tokenizer", + null + ], + [ + "parse_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "disable_tags", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 16 + ] + ], + "source": "def disable_tags(*tag_names)\n @disabled_tags ||= []\n @disabled_tags.concat(tag_names)\n prepend(Disabler)\nend", + "signature": "def disable_tags(*tag_names)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "*tag_names", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "initialize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 25 + ] + ], + "source": "def initialize(tag_name, markup, parse_context)\n @tag_name = tag_name\n @markup = markup\n @parse_context = parse_context\n @line_number = parse_context.line_number\nend", + "signature": "def initialize(tag_name, markup, parse_context)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "a new instance of Tag", + "types": [ + "Tag" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "tag_name", + null + ], + [ + "markup", + null + ], + [ + "parse_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 32 + ] + ], + "source": "def parse(_tokens)\nend", + "signature": "def parse(_tokens)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "_tokens", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "raw", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 35 + ] + ], + "source": "def raw\n \"#{@tag_name} #{@markup}\"\nend", + "signature": "def raw", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "name", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 39 + ] + ], + "source": "def name\n self.class.name.downcase\nend", + "signature": "def name", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "render", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 43 + ] + ], + "source": "def render(_context)\n ''\nend", + "signature": "def render(_context)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "blank?", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 55 + ] + ], + "source": "def blank?\n false\nend", + "signature": "def blank?", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "", + "types": [ + "Boolean" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_expression", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 61 + ] + ], + "source": "def parse_expression(markup)\n parse_context.parse_expression(markup)\nend", + "signature": "def parse_expression(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "strict_parse_with_error_mode_fallback", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 5 + ] + ], + "source": "def strict_parse_with_error_mode_fallback(markup)\n strict_parse_with_error_context(markup)\nrescue SyntaxError => e\n case parse_context.error_mode\n when :strict\n raise\n when :warn\n parse_context.warnings << e\n end\n lax_parse(markup)\nend", + "signature": "def strict_parse_with_error_mode_fallback(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_with_selected_parser", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 17 + ] + ], + "source": "def parse_with_selected_parser(markup)\n case parse_context.error_mode\n when :strict then strict_parse_with_error_context(markup)\n when :lax then lax_parse(markup)\n when :warn\n begin\n strict_parse_with_error_context(markup)\n rescue SyntaxError => e\n parse_context.warnings << e\n lax_parse(markup)\n end\n end\nend", + "signature": "def parse_with_selected_parser(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "strict_parse_with_error_context", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 33 + ] + ], + "source": "def strict_parse_with_error_context(markup)\n strict_parse(markup)\nrescue SyntaxError => e\n e.line_number = line_number\n e.markup_context = markup_context(markup)\n raise e\nend", + "signature": "def strict_parse_with_error_context(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "markup_context", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 41 + ] + ], + "source": "def markup_context(markup)\n \"in \\\"#{markup.strip}\\\"\"\nend", + "signature": "def markup_context(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + } + ], + "constants": [ + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "INTERRUPT", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Continue", + "files": [ + [ + "lib/liquid/tags/continue.rb", + 14 + ] + ], + "source": "INTERRUPT = ContinueInterrupt.new.freeze", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "ContinueInterrupt.new.freeze" + } + ], + "instance_attributes": { + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "Decrement", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/tags/decrement.rb", + 22 + ] + ], + "source": null, + "signature": null, + "docstring": "Hello: {% decrement variable %}\n\ngives you:\n\n Hello: -1\n Hello: -2\n Hello: -3", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "initialize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Decrement", + "files": [ + [ + "lib/liquid/tags/decrement.rb", + 23 + ] + ], + "source": "def initialize(tag_name, markup, options)\n super\n @variable = markup.strip\nend", + "signature": "def initialize(tag_name, markup, options)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "a new instance of Decrement", + "types": [ + "Decrement" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "tag_name", + null + ], + [ + "markup", + null + ], + [ + "options", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "render_to_output_buffer", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Decrement", + "files": [ + [ + "lib/liquid/tags/decrement.rb", + 28 + ] + ], + "source": "def render_to_output_buffer(context, output)\n value = context.environments.first[@variable] ||= 0\n value -= 1\n context.environments.first[@variable] = value\n output << value.to_s\n output\nend", + "signature": "def render_to_output_buffer(context, output)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "context", + null + ], + [ + "output", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "nodelist", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def nodelist\n @nodelist\nend", + "signature": "def nodelist", + "docstring": "Returns the value of attribute nodelist.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "tag_name", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def tag_name\n @tag_name\nend", + "signature": "def tag_name", + "docstring": "Returns the value of attribute tag_name.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "line_number", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def line_number\n @line_number\nend", + "signature": "def line_number", + "docstring": "Returns the value of attribute line_number.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_context", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def parse_context\n @parse_context\nend", + "signature": "def parse_context", + "docstring": "Returns the value of attribute parse_context.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + "Liquid::Tag#options" + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "options", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 6 + ] + ], + "source": "def parse_context\n @parse_context\nend", + "signature": "def parse_context", + "docstring": "Returns the value of attribute parse_context.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 10 + ] + ], + "source": "def parse(tag_name, markup, tokenizer, parse_context)\n tag = new(tag_name, markup, parse_context)\n tag.parse(tokenizer)\n tag\nend", + "signature": "def parse(tag_name, markup, tokenizer, parse_context)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "tag_name", + null + ], + [ + "markup", + null + ], + [ + "tokenizer", + null + ], + [ + "parse_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "disable_tags", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 16 + ] + ], + "source": "def disable_tags(*tag_names)\n @disabled_tags ||= []\n @disabled_tags.concat(tag_names)\n prepend(Disabler)\nend", + "signature": "def disable_tags(*tag_names)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "*tag_names", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 32 + ] + ], + "source": "def parse(_tokens)\nend", + "signature": "def parse(_tokens)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "_tokens", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "raw", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 35 + ] + ], + "source": "def raw\n \"#{@tag_name} #{@markup}\"\nend", + "signature": "def raw", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "name", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 39 + ] + ], + "source": "def name\n self.class.name.downcase\nend", + "signature": "def name", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "render", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 43 + ] + ], + "source": "def render(_context)\n ''\nend", + "signature": "def render(_context)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "blank?", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 55 + ] + ], + "source": "def blank?\n false\nend", + "signature": "def blank?", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "", + "types": [ + "Boolean" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_expression", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 61 + ] + ], + "source": "def parse_expression(markup)\n parse_context.parse_expression(markup)\nend", + "signature": "def parse_expression(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "strict_parse_with_error_mode_fallback", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 5 + ] + ], + "source": "def strict_parse_with_error_mode_fallback(markup)\n strict_parse_with_error_context(markup)\nrescue SyntaxError => e\n case parse_context.error_mode\n when :strict\n raise\n when :warn\n parse_context.warnings << e\n end\n lax_parse(markup)\nend", + "signature": "def strict_parse_with_error_mode_fallback(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_with_selected_parser", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 17 + ] + ], + "source": "def parse_with_selected_parser(markup)\n case parse_context.error_mode\n when :strict then strict_parse_with_error_context(markup)\n when :lax then lax_parse(markup)\n when :warn\n begin\n strict_parse_with_error_context(markup)\n rescue SyntaxError => e\n parse_context.warnings << e\n lax_parse(markup)\n end\n end\nend", + "signature": "def parse_with_selected_parser(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "strict_parse_with_error_context", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 33 + ] + ], + "source": "def strict_parse_with_error_context(markup)\n strict_parse(markup)\nrescue SyntaxError => e\n e.line_number = line_number\n e.markup_context = markup_context(markup)\n raise e\nend", + "signature": "def strict_parse_with_error_context(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "markup_context", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 41 + ] + ], + "source": "def markup_context(markup)\n \"in \\\"#{markup.strip}\\\"\"\nend", + "signature": "def markup_context(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + } + ], + "constants": [ + + ], + "instance_attributes": { + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "Ifchanged", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/tags/ifchanged.rb", + 4 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "render_to_output_buffer", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Ifchanged", + "files": [ + [ + "lib/liquid/tags/ifchanged.rb", + 5 + ] + ], + "source": "def render_to_output_buffer(context, output)\n block_output = +''\n super(context, block_output)\n\n if block_output != context.registers[:ifchanged]\n context.registers[:ifchanged] = block_output\n output << block_output\n end\n\n output\nend", + "signature": "def render_to_output_buffer(context, output)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "context", + null + ], + [ + "output", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "initialize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 7 + ] + ], + "source": "def initialize(tag_name, markup, options)\n super\n @blank = true\nend", + "signature": "def initialize(tag_name, markup, options)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "a new instance of Block", + "types": [ + "Block" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "tag_name", + null + ], + [ + "markup", + null + ], + [ + "options", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 12 + ] + ], + "source": "def parse(tokens)\n @body = new_body\n while parse_body(@body, tokens)\n end\n @body.freeze\nend", + "signature": "def parse(tokens)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "tokens", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "render", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 20 + ] + ], + "source": "def render(context)\n @body.render(context)\nend", + "signature": "def render(context)", + "docstring": "For backwards compatibility", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "blank?", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 24 + ] + ], + "source": "def blank?\n @blank\nend", + "signature": "def blank?", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "", + "types": [ + "Boolean" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "nodelist", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 28 + ] + ], + "source": "def nodelist\n @body.nodelist\nend", + "signature": "def nodelist", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "unknown_tag", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 32 + ] + ], + "source": "def unknown_tag(tag_name, _markup, _tokenizer)\n Block.raise_unknown_tag(tag_name, block_name, block_delimiter, parse_context)\nend", + "signature": "def unknown_tag(tag_name, _markup, _tokenizer)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "tag_name", + null + ], + [ + "_markup", + null + ], + [ + "_tokenizer", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "raise_unknown_tag", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 37 + ] + ], + "source": "def self.raise_unknown_tag(tag, block_name, block_delimiter, parse_context)\n if tag == 'else'\n raise SyntaxError, parse_context.locale.t(\"errors.syntax.unexpected_else\",\n block_name: block_name)\n elsif tag.start_with?('end')\n raise SyntaxError, parse_context.locale.t(\"errors.syntax.invalid_delimiter\",\n tag: tag,\n block_name: block_name,\n block_delimiter: block_delimiter)\n else\n raise SyntaxError, parse_context.locale.t(\"errors.syntax.unknown_tag\", tag: tag)\n end\nend", + "signature": "def raise_unknown_tag(tag, block_name, block_delimiter, parse_context)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "api", + "text": "private", + "types": null, + "name": null + } + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "tag", + null + ], + [ + "block_name", + null + ], + [ + "block_delimiter", + null + ], + [ + "parse_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "raise_tag_never_closed", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 51 + ] + ], + "source": "def raise_tag_never_closed(block_name)\n raise SyntaxError, parse_context.locale.t(\"errors.syntax.tag_never_closed\", block_name: block_name)\nend", + "signature": "def raise_tag_never_closed(block_name)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "raise", + "text": "", + "types": [ + "SyntaxError" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "block_name", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "block_name", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 55 + ] + ], + "source": "def block_name\n @tag_name\nend", + "signature": "def block_name", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "block_delimiter", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 59 + ] + ], + "source": "def block_delimiter\n @block_delimiter ||= \"end#{block_name}\"\nend", + "signature": "def block_delimiter", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "new_body", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 66 + ] + ], + "source": "def new_body\n parse_context.new_block_body\nend", + "signature": "def new_body", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "api", + "text": "public", + "types": null, + "name": null + } + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_body", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 71 + ] + ], + "source": "def parse_body(body, tokens)\n if parse_context.depth >= MAX_DEPTH\n raise StackLevelError, \"Nesting too deep\"\n end\n parse_context.depth += 1\n begin\n body.parse(tokens, parse_context) do |end_tag_name, end_tag_params|\n @blank &&= body.blank?\n\n return false if end_tag_name == block_delimiter\n raise_tag_never_closed(block_name) unless end_tag_name\n\n # this tag is not registered with the system\n # pass it to the current block for special handling or error reporting\n unknown_tag(end_tag_name, end_tag_params, tokens)\n end\n ensure\n parse_context.depth -= 1\n end\n\n true\nend", + "signature": "def parse_body(body, tokens)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "api", + "text": "public", + "types": null, + "name": null + } + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "body", + null + ], + [ + "tokens", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "tag_name", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def tag_name\n @tag_name\nend", + "signature": "def tag_name", + "docstring": "Returns the value of attribute tag_name.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "line_number", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def line_number\n @line_number\nend", + "signature": "def line_number", + "docstring": "Returns the value of attribute line_number.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_context", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def parse_context\n @parse_context\nend", + "signature": "def parse_context", + "docstring": "Returns the value of attribute parse_context.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + "Liquid::Tag#options" + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "options", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 6 + ] + ], + "source": "def parse_context\n @parse_context\nend", + "signature": "def parse_context", + "docstring": "Returns the value of attribute parse_context.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 10 + ] + ], + "source": "def parse(tag_name, markup, tokenizer, parse_context)\n tag = new(tag_name, markup, parse_context)\n tag.parse(tokenizer)\n tag\nend", + "signature": "def parse(tag_name, markup, tokenizer, parse_context)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "tag_name", + null + ], + [ + "markup", + null + ], + [ + "tokenizer", + null + ], + [ + "parse_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "disable_tags", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 16 + ] + ], + "source": "def disable_tags(*tag_names)\n @disabled_tags ||= []\n @disabled_tags.concat(tag_names)\n prepend(Disabler)\nend", + "signature": "def disable_tags(*tag_names)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "*tag_names", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "raw", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 35 + ] + ], + "source": "def raw\n \"#{@tag_name} #{@markup}\"\nend", + "signature": "def raw", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "name", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 39 + ] + ], + "source": "def name\n self.class.name.downcase\nend", + "signature": "def name", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_expression", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 61 + ] + ], + "source": "def parse_expression(markup)\n parse_context.parse_expression(markup)\nend", + "signature": "def parse_expression(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "strict_parse_with_error_mode_fallback", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 5 + ] + ], + "source": "def strict_parse_with_error_mode_fallback(markup)\n strict_parse_with_error_context(markup)\nrescue SyntaxError => e\n case parse_context.error_mode\n when :strict\n raise\n when :warn\n parse_context.warnings << e\n end\n lax_parse(markup)\nend", + "signature": "def strict_parse_with_error_mode_fallback(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_with_selected_parser", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 17 + ] + ], + "source": "def parse_with_selected_parser(markup)\n case parse_context.error_mode\n when :strict then strict_parse_with_error_context(markup)\n when :lax then lax_parse(markup)\n when :warn\n begin\n strict_parse_with_error_context(markup)\n rescue SyntaxError => e\n parse_context.warnings << e\n lax_parse(markup)\n end\n end\nend", + "signature": "def parse_with_selected_parser(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "strict_parse_with_error_context", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 33 + ] + ], + "source": "def strict_parse_with_error_context(markup)\n strict_parse(markup)\nrescue SyntaxError => e\n e.line_number = line_number\n e.markup_context = markup_context(markup)\n raise e\nend", + "signature": "def strict_parse_with_error_context(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "markup_context", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 41 + ] + ], + "source": "def markup_context(markup)\n \"in \\\"#{markup.strip}\\\"\"\nend", + "signature": "def markup_context(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + } + ], + "constants": [ + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "MAX_DEPTH", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 5 + ] + ], + "source": "MAX_DEPTH = 100", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "100" + } + ], + "instance_attributes": { + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "Increment", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/tags/increment.rb", + 19 + ] + ], + "source": null, + "signature": null, + "docstring": "increment is used in a place where one needs to insert a counter\n into a template, and needs the counter to survive across\n multiple instantiations of the template.\n (To achieve the survival, the application must keep the context)\n\n if the variable does not exist, it is created with value 0.\n\n Hello: {% increment variable %}\n\ngives you:\n\n Hello: 0\n Hello: 1\n Hello: 2", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "initialize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Increment", + "files": [ + [ + "lib/liquid/tags/increment.rb", + 20 + ] + ], + "source": "def initialize(tag_name, markup, options)\n super\n @variable = markup.strip\nend", + "signature": "def initialize(tag_name, markup, options)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "a new instance of Increment", + "types": [ + "Increment" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "tag_name", + null + ], + [ + "markup", + null + ], + [ + "options", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "render_to_output_buffer", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Increment", + "files": [ + [ + "lib/liquid/tags/increment.rb", + 25 + ] + ], + "source": "def render_to_output_buffer(context, output)\n value = context.environments.first[@variable] ||= 0\n context.environments.first[@variable] = value + 1\n\n output << value.to_s\n output\nend", + "signature": "def render_to_output_buffer(context, output)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "context", + null + ], + [ + "output", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "nodelist", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def nodelist\n @nodelist\nend", + "signature": "def nodelist", + "docstring": "Returns the value of attribute nodelist.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "tag_name", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def tag_name\n @tag_name\nend", + "signature": "def tag_name", + "docstring": "Returns the value of attribute tag_name.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "line_number", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def line_number\n @line_number\nend", + "signature": "def line_number", + "docstring": "Returns the value of attribute line_number.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_context", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def parse_context\n @parse_context\nend", + "signature": "def parse_context", + "docstring": "Returns the value of attribute parse_context.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + "Liquid::Tag#options" + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "options", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 6 + ] + ], + "source": "def parse_context\n @parse_context\nend", + "signature": "def parse_context", + "docstring": "Returns the value of attribute parse_context.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 10 + ] + ], + "source": "def parse(tag_name, markup, tokenizer, parse_context)\n tag = new(tag_name, markup, parse_context)\n tag.parse(tokenizer)\n tag\nend", + "signature": "def parse(tag_name, markup, tokenizer, parse_context)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "tag_name", + null + ], + [ + "markup", + null + ], + [ + "tokenizer", + null + ], + [ + "parse_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "disable_tags", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 16 + ] + ], + "source": "def disable_tags(*tag_names)\n @disabled_tags ||= []\n @disabled_tags.concat(tag_names)\n prepend(Disabler)\nend", + "signature": "def disable_tags(*tag_names)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "*tag_names", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 32 + ] + ], + "source": "def parse(_tokens)\nend", + "signature": "def parse(_tokens)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "_tokens", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "raw", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 35 + ] + ], + "source": "def raw\n \"#{@tag_name} #{@markup}\"\nend", + "signature": "def raw", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "name", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 39 + ] + ], + "source": "def name\n self.class.name.downcase\nend", + "signature": "def name", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "render", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 43 + ] + ], + "source": "def render(_context)\n ''\nend", + "signature": "def render(_context)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "blank?", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 55 + ] + ], + "source": "def blank?\n false\nend", + "signature": "def blank?", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "", + "types": [ + "Boolean" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_expression", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 61 + ] + ], + "source": "def parse_expression(markup)\n parse_context.parse_expression(markup)\nend", + "signature": "def parse_expression(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "strict_parse_with_error_mode_fallback", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 5 + ] + ], + "source": "def strict_parse_with_error_mode_fallback(markup)\n strict_parse_with_error_context(markup)\nrescue SyntaxError => e\n case parse_context.error_mode\n when :strict\n raise\n when :warn\n parse_context.warnings << e\n end\n lax_parse(markup)\nend", + "signature": "def strict_parse_with_error_mode_fallback(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_with_selected_parser", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 17 + ] + ], + "source": "def parse_with_selected_parser(markup)\n case parse_context.error_mode\n when :strict then strict_parse_with_error_context(markup)\n when :lax then lax_parse(markup)\n when :warn\n begin\n strict_parse_with_error_context(markup)\n rescue SyntaxError => e\n parse_context.warnings << e\n lax_parse(markup)\n end\n end\nend", + "signature": "def parse_with_selected_parser(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "strict_parse_with_error_context", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 33 + ] + ], + "source": "def strict_parse_with_error_context(markup)\n strict_parse(markup)\nrescue SyntaxError => e\n e.line_number = line_number\n e.markup_context = markup_context(markup)\n raise e\nend", + "signature": "def strict_parse_with_error_context(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "markup_context", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 41 + ] + ], + "source": "def markup_context(markup)\n \"in \\\"#{markup.strip}\\\"\"\nend", + "signature": "def markup_context(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + } + ], + "constants": [ + + ], + "instance_attributes": { + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "TableRow", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/tags/table_row.rb", + 4 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "variable_name", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "TableRow", + "files": [ + [ + "lib/liquid/tags/table_row.rb", + 7 + ] + ], + "source": "def variable_name\n @variable_name\nend", + "signature": "def variable_name", + "docstring": "Returns the value of attribute variable_name.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "collection_name", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "TableRow", + "files": [ + [ + "lib/liquid/tags/table_row.rb", + 7 + ] + ], + "source": "def collection_name\n @collection_name\nend", + "signature": "def collection_name", + "docstring": "Returns the value of attribute collection_name.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "attributes", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "TableRow", + "files": [ + [ + "lib/liquid/tags/table_row.rb", + 7 + ] + ], + "source": "def attributes\n @attributes\nend", + "signature": "def attributes", + "docstring": "Returns the value of attribute attributes.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "initialize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "TableRow", + "files": [ + [ + "lib/liquid/tags/table_row.rb", + 9 + ] + ], + "source": "def initialize(tag_name, markup, options)\n super\n if markup =~ Syntax\n @variable_name = Regexp.last_match(1)\n @collection_name = parse_expression(Regexp.last_match(2))\n @attributes = {}\n markup.scan(TagAttributes) do |key, value|\n @attributes[key] = parse_expression(value)\n end\n else\n raise SyntaxError, options[:locale].t(\"errors.syntax.table_row\")\n end\nend", + "signature": "def initialize(tag_name, markup, options)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "a new instance of TableRow", + "types": [ + "TableRow" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "tag_name", + null + ], + [ + "markup", + null + ], + [ + "options", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "render_to_output_buffer", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "TableRow", + "files": [ + [ + "lib/liquid/tags/table_row.rb", + 23 + ] + ], + "source": "def render_to_output_buffer(context, output)\n (collection = context.evaluate(@collection_name)) || (return '')\n\n from = @attributes.key?('offset') ? context.evaluate(@attributes['offset']).to_i : 0\n to = @attributes.key?('limit') ? from + context.evaluate(@attributes['limit']).to_i : nil\n\n collection = Utils.slice_collection(collection, from, to)\n length = collection.length\n\n cols = context.evaluate(@attributes['cols']).to_i\n\n output << \"\\n\"\n context.stack do\n tablerowloop = Liquid::TablerowloopDrop.new(length, cols)\n context['tablerowloop'] = tablerowloop\n\n collection.each do |item|\n context[@variable_name] = item\n\n output << \"\"\n super\n output << ''\n\n if tablerowloop.col_last && !tablerowloop.last\n output << \"\\n\"\n end\n\n tablerowloop.send(:increment!)\n end\n end\n\n output << \"\\n\"\n output\nend", + "signature": "def render_to_output_buffer(context, output)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "context", + null + ], + [ + "output", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 12 + ] + ], + "source": "def parse(tokens)\n @body = new_body\n while parse_body(@body, tokens)\n end\n @body.freeze\nend", + "signature": "def parse(tokens)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "tokens", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "render", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 20 + ] + ], + "source": "def render(context)\n @body.render(context)\nend", + "signature": "def render(context)", + "docstring": "For backwards compatibility", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "blank?", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 24 + ] + ], + "source": "def blank?\n @blank\nend", + "signature": "def blank?", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "", + "types": [ + "Boolean" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "nodelist", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 28 + ] + ], + "source": "def nodelist\n @body.nodelist\nend", + "signature": "def nodelist", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "unknown_tag", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 32 + ] + ], + "source": "def unknown_tag(tag_name, _markup, _tokenizer)\n Block.raise_unknown_tag(tag_name, block_name, block_delimiter, parse_context)\nend", + "signature": "def unknown_tag(tag_name, _markup, _tokenizer)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "tag_name", + null + ], + [ + "_markup", + null + ], + [ + "_tokenizer", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "raise_unknown_tag", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 37 + ] + ], + "source": "def self.raise_unknown_tag(tag, block_name, block_delimiter, parse_context)\n if tag == 'else'\n raise SyntaxError, parse_context.locale.t(\"errors.syntax.unexpected_else\",\n block_name: block_name)\n elsif tag.start_with?('end')\n raise SyntaxError, parse_context.locale.t(\"errors.syntax.invalid_delimiter\",\n tag: tag,\n block_name: block_name,\n block_delimiter: block_delimiter)\n else\n raise SyntaxError, parse_context.locale.t(\"errors.syntax.unknown_tag\", tag: tag)\n end\nend", + "signature": "def raise_unknown_tag(tag, block_name, block_delimiter, parse_context)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "api", + "text": "private", + "types": null, + "name": null + } + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "tag", + null + ], + [ + "block_name", + null + ], + [ + "block_delimiter", + null + ], + [ + "parse_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "raise_tag_never_closed", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 51 + ] + ], + "source": "def raise_tag_never_closed(block_name)\n raise SyntaxError, parse_context.locale.t(\"errors.syntax.tag_never_closed\", block_name: block_name)\nend", + "signature": "def raise_tag_never_closed(block_name)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "raise", + "text": "", + "types": [ + "SyntaxError" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "block_name", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "block_name", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 55 + ] + ], + "source": "def block_name\n @tag_name\nend", + "signature": "def block_name", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "block_delimiter", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 59 + ] + ], + "source": "def block_delimiter\n @block_delimiter ||= \"end#{block_name}\"\nend", + "signature": "def block_delimiter", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "new_body", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 66 + ] + ], + "source": "def new_body\n parse_context.new_block_body\nend", + "signature": "def new_body", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "api", + "text": "public", + "types": null, + "name": null + } + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_body", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 71 + ] + ], + "source": "def parse_body(body, tokens)\n if parse_context.depth >= MAX_DEPTH\n raise StackLevelError, \"Nesting too deep\"\n end\n parse_context.depth += 1\n begin\n body.parse(tokens, parse_context) do |end_tag_name, end_tag_params|\n @blank &&= body.blank?\n\n return false if end_tag_name == block_delimiter\n raise_tag_never_closed(block_name) unless end_tag_name\n\n # this tag is not registered with the system\n # pass it to the current block for special handling or error reporting\n unknown_tag(end_tag_name, end_tag_params, tokens)\n end\n ensure\n parse_context.depth -= 1\n end\n\n true\nend", + "signature": "def parse_body(body, tokens)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "api", + "text": "public", + "types": null, + "name": null + } + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "body", + null + ], + [ + "tokens", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "tag_name", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def tag_name\n @tag_name\nend", + "signature": "def tag_name", + "docstring": "Returns the value of attribute tag_name.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "line_number", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def line_number\n @line_number\nend", + "signature": "def line_number", + "docstring": "Returns the value of attribute line_number.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_context", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 5 + ] + ], + "source": "def parse_context\n @parse_context\nend", + "signature": "def parse_context", + "docstring": "Returns the value of attribute parse_context.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + "Liquid::Tag#options" + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "options", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 6 + ] + ], + "source": "def parse_context\n @parse_context\nend", + "signature": "def parse_context", + "docstring": "Returns the value of attribute parse_context.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 10 + ] + ], + "source": "def parse(tag_name, markup, tokenizer, parse_context)\n tag = new(tag_name, markup, parse_context)\n tag.parse(tokenizer)\n tag\nend", + "signature": "def parse(tag_name, markup, tokenizer, parse_context)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "tag_name", + null + ], + [ + "markup", + null + ], + [ + "tokenizer", + null + ], + [ + "parse_context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "disable_tags", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 16 + ] + ], + "source": "def disable_tags(*tag_names)\n @disabled_tags ||= []\n @disabled_tags.concat(tag_names)\n prepend(Disabler)\nend", + "signature": "def disable_tags(*tag_names)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "*tag_names", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "raw", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 35 + ] + ], + "source": "def raw\n \"#{@tag_name} #{@markup}\"\nend", + "signature": "def raw", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "name", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 39 + ] + ], + "source": "def name\n self.class.name.downcase\nend", + "signature": "def name", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_expression", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Tag", + "files": [ + [ + "lib/liquid/tag.rb", + 61 + ] + ], + "source": "def parse_expression(markup)\n parse_context.parse_expression(markup)\nend", + "signature": "def parse_expression(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "strict_parse_with_error_mode_fallback", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 5 + ] + ], + "source": "def strict_parse_with_error_mode_fallback(markup)\n strict_parse_with_error_context(markup)\nrescue SyntaxError => e\n case parse_context.error_mode\n when :strict\n raise\n when :warn\n parse_context.warnings << e\n end\n lax_parse(markup)\nend", + "signature": "def strict_parse_with_error_mode_fallback(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse_with_selected_parser", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 17 + ] + ], + "source": "def parse_with_selected_parser(markup)\n case parse_context.error_mode\n when :strict then strict_parse_with_error_context(markup)\n when :lax then lax_parse(markup)\n when :warn\n begin\n strict_parse_with_error_context(markup)\n rescue SyntaxError => e\n parse_context.warnings << e\n lax_parse(markup)\n end\n end\nend", + "signature": "def parse_with_selected_parser(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "strict_parse_with_error_context", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 33 + ] + ], + "source": "def strict_parse_with_error_context(markup)\n strict_parse(markup)\nrescue SyntaxError => e\n e.line_number = line_number\n e.markup_context = markup_context(markup)\n raise e\nend", + "signature": "def strict_parse_with_error_context(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "markup_context", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "ParserSwitching", + "files": [ + [ + "lib/liquid/parser_switching.rb", + 41 + ] + ], + "source": "def markup_context(markup)\n \"in \\\"#{markup.strip}\\\"\"\nend", + "signature": "def markup_context(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + } + ], + "constants": [ + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "Syntax", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "TableRow", + "files": [ + [ + "lib/liquid/tags/table_row.rb", + 5 + ] + ], + "source": "Syntax = /(\\w+)\\s+in\\s+(#{QuotedFragment}+)/o", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "/(\\w+)\\s+in\\s+(#{QuotedFragment}+)/o" + }, + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "MAX_DEPTH", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Block", + "files": [ + [ + "lib/liquid/block.rb", + 5 + ] + ], + "source": "MAX_DEPTH = 100", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "100" + } + ], + "instance_attributes": { + "variable_name": { + "read": "Liquid::TableRow#variable_name", + "write": null + }, + "collection_name": { + "read": "Liquid::TableRow#collection_name", + "write": null + }, + "attributes": { + "read": "Liquid::TableRow#attributes", + "write": null + } + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "ParseTreeVisitor", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "TableRow", + "files": [ + [ + "lib/liquid/tags/table_row.rb", + 58 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "children", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/tags/table_row.rb", + 59 + ] + ], + "source": "def children\n super + @node.attributes.values + [@node.collection_name]\nend", + "signature": "def children", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "for", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/parse_tree_visitor.rb", + 5 + ] + ], + "source": "def self.for(node, callbacks = Hash.new(proc {}))\n if defined?(node.class::ParseTreeVisitor)\n node.class::ParseTreeVisitor\n else\n self\n end.new(node, callbacks)\nend", + "signature": "def for(node, callbacks = Hash.new(proc {}))", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "node", + null + ], + [ + "callbacks", + "Hash.new(proc {})" + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "initialize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/parse_tree_visitor.rb", + 13 + ] + ], + "source": "def initialize(node, callbacks)\n @node = node\n @callbacks = callbacks\nend", + "signature": "def initialize(node, callbacks)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "a new instance of ParseTreeVisitor", + "types": [ + "ParseTreeVisitor" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "node", + null + ], + [ + "callbacks", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "add_callback_for", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/parse_tree_visitor.rb", + 18 + ] + ], + "source": "def add_callback_for(*classes, &block)\n callback = block\n callback = ->(node, _) { yield node } if block.arity.abs == 1\n callback = ->(_, _) { yield } if block.arity.zero?\n classes.each { |klass| @callbacks[klass] = callback }\n self\nend", + "signature": "def add_callback_for(*classes, &block)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "*classes", + null + ], + [ + "&block", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "visit", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/parse_tree_visitor.rb", + 26 + ] + ], + "source": "def visit(context = nil)\n children.map do |node|\n item, new_context = @callbacks[node.class].call(node, context)\n [\n item,\n ParseTreeVisitor.for(node, @callbacks).visit(new_context || context),\n ]\n end\nend", + "signature": "def visit(context = nil)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "context", + "nil" + ] + ], + "aliases": [ + + ] + } + ], + "constants": [ + + ], + "instance_attributes": { + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "ResourceLimits", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/resource_limits.rb", + 4 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "render_length_limit", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ResourceLimits", + "files": [ + [ + "lib/liquid/resource_limits.rb", + 5 + ] + ], + "source": "def render_length_limit\n @render_length_limit\nend", + "signature": "def render_length_limit", + "docstring": "Returns the value of attribute render_length_limit.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "render_length_limit=", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ResourceLimits", + "files": [ + [ + "lib/liquid/resource_limits.rb", + 5 + ] + ], + "source": "def render_length_limit=(value)\n @render_length_limit = value\nend", + "signature": "def render_length_limit=(value)", + "docstring": "Sets the attribute render_length_limit", + "dynamic": true, + "tags": [ + { + "tag_name": "param", + "text": "the value to set the attribute render_length_limit to.", + "types": null, + "name": "value" + } + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + [ + "value", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "render_score_limit", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ResourceLimits", + "files": [ + [ + "lib/liquid/resource_limits.rb", + 5 + ] + ], + "source": "def render_score_limit\n @render_score_limit\nend", + "signature": "def render_score_limit", + "docstring": "Returns the value of attribute render_score_limit.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "render_score_limit=", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ResourceLimits", + "files": [ + [ + "lib/liquid/resource_limits.rb", + 5 + ] + ], + "source": "def render_score_limit=(value)\n @render_score_limit = value\nend", + "signature": "def render_score_limit=(value)", + "docstring": "Sets the attribute render_score_limit", + "dynamic": true, + "tags": [ + { + "tag_name": "param", + "text": "the value to set the attribute render_score_limit to.", + "types": null, + "name": "value" + } + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + [ + "value", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "assign_score_limit", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ResourceLimits", + "files": [ + [ + "lib/liquid/resource_limits.rb", + 5 + ] + ], + "source": "def assign_score_limit\n @assign_score_limit\nend", + "signature": "def assign_score_limit", + "docstring": "Returns the value of attribute assign_score_limit.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "assign_score_limit=", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ResourceLimits", + "files": [ + [ + "lib/liquid/resource_limits.rb", + 5 + ] + ], + "source": "def assign_score_limit=(value)\n @assign_score_limit = value\nend", + "signature": "def assign_score_limit=(value)", + "docstring": "Sets the attribute assign_score_limit", + "dynamic": true, + "tags": [ + { + "tag_name": "param", + "text": "the value to set the attribute assign_score_limit to.", + "types": null, + "name": "value" + } + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + [ + "value", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "render_score", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ResourceLimits", + "files": [ + [ + "lib/liquid/resource_limits.rb", + 6 + ] + ], + "source": "def render_score\n @render_score\nend", + "signature": "def render_score", + "docstring": "Returns the value of attribute render_score.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "assign_score", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ResourceLimits", + "files": [ + [ + "lib/liquid/resource_limits.rb", + 6 + ] + ], + "source": "def assign_score\n @assign_score\nend", + "signature": "def assign_score", + "docstring": "Returns the value of attribute assign_score.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "initialize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ResourceLimits", + "files": [ + [ + "lib/liquid/resource_limits.rb", + 8 + ] + ], + "source": "def initialize(limits)\n @render_length_limit = limits[:render_length_limit]\n @render_score_limit = limits[:render_score_limit]\n @assign_score_limit = limits[:assign_score_limit]\n reset\nend", + "signature": "def initialize(limits)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "a new instance of ResourceLimits", + "types": [ + "ResourceLimits" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "limits", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "increment_render_score", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ResourceLimits", + "files": [ + [ + "lib/liquid/resource_limits.rb", + 15 + ] + ], + "source": "def increment_render_score(amount)\n @render_score += amount\n raise_limits_reached if @render_score_limit && @render_score > @render_score_limit\nend", + "signature": "def increment_render_score(amount)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "amount", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "increment_assign_score", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ResourceLimits", + "files": [ + [ + "lib/liquid/resource_limits.rb", + 20 + ] + ], + "source": "def increment_assign_score(amount)\n @assign_score += amount\n raise_limits_reached if @assign_score_limit && @assign_score > @assign_score_limit\nend", + "signature": "def increment_assign_score(amount)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "amount", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "increment_write_score", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ResourceLimits", + "files": [ + [ + "lib/liquid/resource_limits.rb", + 26 + ] + ], + "source": "def increment_write_score(output)\n if (last_captured = @last_capture_length)\n captured = output.bytesize\n increment = captured - last_captured\n @last_capture_length = captured\n increment_assign_score(increment)\n elsif @render_length_limit && output.bytesize > @render_length_limit\n raise_limits_reached\n end\nend", + "signature": "def increment_write_score(output)", + "docstring": "update either render_length or assign_score based on whether or not the writes are captured", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "output", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "raise_limits_reached", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ResourceLimits", + "files": [ + [ + "lib/liquid/resource_limits.rb", + 37 + ] + ], + "source": "def raise_limits_reached\n @reached_limit = true\n raise MemoryError, \"Memory limits exceeded\"\nend", + "signature": "def raise_limits_reached", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "raise", + "text": "", + "types": [ + "MemoryError" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "reached?", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ResourceLimits", + "files": [ + [ + "lib/liquid/resource_limits.rb", + 42 + ] + ], + "source": "def reached?\n @reached_limit\nend", + "signature": "def reached?", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "", + "types": [ + "Boolean" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "reset", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ResourceLimits", + "files": [ + [ + "lib/liquid/resource_limits.rb", + 46 + ] + ], + "source": "def reset\n @reached_limit = false\n @last_capture_length = nil\n @render_score = @assign_score = 0\nend", + "signature": "def reset", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "with_capture", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ResourceLimits", + "files": [ + [ + "lib/liquid/resource_limits.rb", + 52 + ] + ], + "source": "def with_capture\n old_capture_length = @last_capture_length\n begin\n @last_capture_length = 0\n yield\n ensure\n @last_capture_length = old_capture_length\n end\nend", + "signature": "def with_capture", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + } + ], + "constants": [ + + ], + "instance_attributes": { + "render_length_limit": { + "read": "Liquid::ResourceLimits#render_length_limit", + "write": "Liquid::ResourceLimits#render_length_limit=" + }, + "render_score_limit": { + "read": "Liquid::ResourceLimits#render_score_limit", + "write": "Liquid::ResourceLimits#render_score_limit=" + }, + "assign_score_limit": { + "read": "Liquid::ResourceLimits#assign_score_limit", + "write": "Liquid::ResourceLimits#assign_score_limit=" + }, + "render_score": { + "read": "Liquid::ResourceLimits#render_score", + "write": null + }, + "assign_score": { + "read": "Liquid::ResourceLimits#assign_score", + "write": null + } + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "InputIterator", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "StandardFilters", + "files": [ + [ + "lib/liquid/standardfilters.rb", + 504 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "initialize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "InputIterator", + "files": [ + [ + "lib/liquid/standardfilters.rb", + 507 + ] + ], + "source": "def initialize(input, context)\n @context = context\n @input = if input.is_a?(Array)\n input.flatten\n elsif input.is_a?(Hash)\n [input]\n elsif input.is_a?(Enumerable)\n input\n else\n Array(input)\n end\nend", + "signature": "def initialize(input, context)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "a new instance of InputIterator", + "types": [ + "InputIterator" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "input", + null + ], + [ + "context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "join", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "InputIterator", + "files": [ + [ + "lib/liquid/standardfilters.rb", + 520 + ] + ], + "source": "def join(glue)\n to_a.join(glue.to_s)\nend", + "signature": "def join(glue)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "glue", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "concat", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "InputIterator", + "files": [ + [ + "lib/liquid/standardfilters.rb", + 524 + ] + ], + "source": "def concat(args)\n to_a.concat(args)\nend", + "signature": "def concat(args)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "args", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "reverse", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "InputIterator", + "files": [ + [ + "lib/liquid/standardfilters.rb", + 528 + ] + ], + "source": "def reverse\n reverse_each.to_a\nend", + "signature": "def reverse", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "uniq", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "InputIterator", + "files": [ + [ + "lib/liquid/standardfilters.rb", + 532 + ] + ], + "source": "def uniq(&block)\n to_a.uniq(&block)\nend", + "signature": "def uniq(&block)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "&block", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "compact", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "InputIterator", + "files": [ + [ + "lib/liquid/standardfilters.rb", + 536 + ] + ], + "source": "def compact\n to_a.compact\nend", + "signature": "def compact", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "empty?", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "InputIterator", + "files": [ + [ + "lib/liquid/standardfilters.rb", + 540 + ] + ], + "source": "def empty?\n @input.each { return false }\n true\nend", + "signature": "def empty?", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "", + "types": [ + "Boolean" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "each", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "InputIterator", + "files": [ + [ + "lib/liquid/standardfilters.rb", + 545 + ] + ], + "source": "def each\n @input.each do |e|\n e.context = @context if e.respond_to?(:context=)\n yield(e.respond_to?(:to_liquid) ? e.to_liquid : e)\n end\nend", + "signature": "def each", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + } + ], + "constants": [ + + ], + "instance_attributes": { + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + null + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "VariableLookup", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/variable_lookup.rb", + 4 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "name", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "VariableLookup", + "files": [ + [ + "lib/liquid/variable_lookup.rb", + 8 + ] + ], + "source": "def name\n @name\nend", + "signature": "def name", + "docstring": "Returns the value of attribute name.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "lookups", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "VariableLookup", + "files": [ + [ + "lib/liquid/variable_lookup.rb", + 8 + ] + ], + "source": "def lookups\n @lookups\nend", + "signature": "def lookups", + "docstring": "Returns the value of attribute lookups.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "parse", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "VariableLookup", + "files": [ + [ + "lib/liquid/variable_lookup.rb", + 10 + ] + ], + "source": "def self.parse(markup)\n new(markup)\nend", + "signature": "def parse(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "initialize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "VariableLookup", + "files": [ + [ + "lib/liquid/variable_lookup.rb", + 14 + ] + ], + "source": "def initialize(markup)\n lookups = markup.scan(VariableParser)\n\n name = lookups.shift\n if name =~ SQUARE_BRACKETED\n name = Expression.parse(Regexp.last_match(1))\n end\n @name = name\n\n @lookups = lookups\n @command_flags = 0\n\n @lookups.each_index do |i|\n lookup = lookups[i]\n if lookup =~ SQUARE_BRACKETED\n lookups[i] = Expression.parse(Regexp.last_match(1))\n elsif COMMAND_METHODS.include?(lookup)\n @command_flags |= 1 << i\n end\n end\nend", + "signature": "def initialize(markup)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "a new instance of VariableLookup", + "types": [ + "VariableLookup" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "markup", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "evaluate", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "VariableLookup", + "files": [ + [ + "lib/liquid/variable_lookup.rb", + 36 + ] + ], + "source": "def evaluate(context)\n name = context.evaluate(@name)\n object = context.find_variable(name)\n\n @lookups.each_index do |i|\n key = context.evaluate(@lookups[i])\n\n # Cast \"key\" to its liquid value to enable it to act as a primitive value\n key = Liquid::Utils.to_liquid_value(key)\n\n # If object is a hash- or array-like object we look for the\n # presence of the key and if its available we return it\n if object.respond_to?(:[]) &&\n ((object.respond_to?(:key?) && object.key?(key)) ||\n (object.respond_to?(:fetch) && key.is_a?(Integer)))\n\n # if its a proc we will replace the entry with the proc\n res = context.lookup_and_evaluate(object, key)\n object = res.to_liquid\n\n # Some special cases. If the part wasn't in square brackets and\n # no key with the same name was found we interpret following calls\n # as commands and call them on the current object\n elsif @command_flags & (1 << i) != 0 && object.respond_to?(key)\n object = object.send(key).to_liquid\n\n # No key was present with the desired value and it wasn't one of the directly supported\n # keywords either. The only thing we got left is to return nil or\n # raise an exception if `strict_variables` option is set to true\n else\n return nil unless context.strict_variables\n raise Liquid::UndefinedVariable, \"undefined variable #{key}\"\n end\n\n # If we are dealing with a drop here we have to\n object.context = context if object.respond_to?(:context=)\n end\n\n object\nend", + "signature": "def evaluate(context)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "==", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "VariableLookup", + "files": [ + [ + "lib/liquid/variable_lookup.rb", + 77 + ] + ], + "source": "def ==(other)\n self.class == other.class && state == other.state\nend", + "signature": "def ==(other)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "other", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "state", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "VariableLookup", + "files": [ + [ + "lib/liquid/variable_lookup.rb", + 83 + ] + ], + "source": "def state\n [@name, @lookups, @command_flags]\nend", + "signature": "def state", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "protected", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + } + ], + "constants": [ + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "SQUARE_BRACKETED", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "VariableLookup", + "files": [ + [ + "lib/liquid/variable_lookup.rb", + 5 + ] + ], + "source": "SQUARE_BRACKETED = /\\A\\[(.*)\\]\\z/m", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "/\\A\\[(.*)\\]\\z/m" + }, + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "COMMAND_METHODS", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "VariableLookup", + "files": [ + [ + "lib/liquid/variable_lookup.rb", + 6 + ] + ], + "source": "COMMAND_METHODS = ['size', 'first', 'last'].freeze", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "['size', 'first', 'last'].freeze" + } + ], + "instance_attributes": { + "name": { + "read": "Liquid::VariableLookup#name", + "write": null + }, + "lookups": { + "read": "Liquid::VariableLookup#lookups", + "write": null + } + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "ParseTreeVisitor", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "VariableLookup", + "files": [ + [ + "lib/liquid/variable_lookup.rb", + 87 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "children", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/variable_lookup.rb", + 88 + ] + ], + "source": "def children\n @node.lookups\nend", + "signature": "def children", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "for", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/parse_tree_visitor.rb", + 5 + ] + ], + "source": "def self.for(node, callbacks = Hash.new(proc {}))\n if defined?(node.class::ParseTreeVisitor)\n node.class::ParseTreeVisitor\n else\n self\n end.new(node, callbacks)\nend", + "signature": "def for(node, callbacks = Hash.new(proc {}))", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "node", + null + ], + [ + "callbacks", + "Hash.new(proc {})" + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "initialize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/parse_tree_visitor.rb", + 13 + ] + ], + "source": "def initialize(node, callbacks)\n @node = node\n @callbacks = callbacks\nend", + "signature": "def initialize(node, callbacks)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "a new instance of ParseTreeVisitor", + "types": [ + "ParseTreeVisitor" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "node", + null + ], + [ + "callbacks", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "add_callback_for", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/parse_tree_visitor.rb", + 18 + ] + ], + "source": "def add_callback_for(*classes, &block)\n callback = block\n callback = ->(node, _) { yield node } if block.arity.abs == 1\n callback = ->(_, _) { yield } if block.arity.zero?\n classes.each { |klass| @callbacks[klass] = callback }\n self\nend", + "signature": "def add_callback_for(*classes, &block)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "*classes", + null + ], + [ + "&block", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "visit", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/parse_tree_visitor.rb", + 26 + ] + ], + "source": "def visit(context = nil)\n children.map do |node|\n item, new_context = @callbacks[node.class].call(node, context)\n [\n item,\n ParseTreeVisitor.for(node, @callbacks).visit(new_context || context),\n ]\n end\nend", + "signature": "def visit(context = nil)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "context", + "nil" + ] + ], + "aliases": [ + + ] + } + ], + "constants": [ + + ], + "instance_attributes": { + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "StaticRegisters", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/static_registers.rb", + 4 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "static", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "StaticRegisters", + "files": [ + [ + "lib/liquid/static_registers.rb", + 5 + ] + ], + "source": "def static\n @static\nend", + "signature": "def static", + "docstring": "Returns the value of attribute static.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "initialize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "StaticRegisters", + "files": [ + [ + "lib/liquid/static_registers.rb", + 7 + ] + ], + "source": "def initialize(registers = {})\n @static = registers.is_a?(StaticRegisters) ? registers.static : registers\n @registers = {}\nend", + "signature": "def initialize(registers = {})", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "a new instance of StaticRegisters", + "types": [ + "StaticRegisters" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "registers", + "{}" + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "[]=", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "StaticRegisters", + "files": [ + [ + "lib/liquid/static_registers.rb", + 12 + ] + ], + "source": "def []=(key, value)\n @registers[key] = value\nend", + "signature": "def []=(key, value)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "key", + null + ], + [ + "value", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "[]", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "StaticRegisters", + "files": [ + [ + "lib/liquid/static_registers.rb", + 16 + ] + ], + "source": "def [](key)\n if @registers.key?(key)\n @registers[key]\n else\n @static[key]\n end\nend", + "signature": "def [](key)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "key", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "delete", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "StaticRegisters", + "files": [ + [ + "lib/liquid/static_registers.rb", + 24 + ] + ], + "source": "def delete(key)\n @registers.delete(key)\nend", + "signature": "def delete(key)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "key", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "fetch", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "StaticRegisters", + "files": [ + [ + "lib/liquid/static_registers.rb", + 30 + ] + ], + "source": "def fetch(key, default = UNDEFINED, &block)\n if @registers.key?(key)\n @registers.fetch(key)\n elsif default != UNDEFINED\n @static.fetch(key, default, &block)\n else\n @static.fetch(key, &block)\n end\nend", + "signature": "def fetch(key, default = UNDEFINED, &block)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "key", + null + ], + [ + "default", + "UNDEFINED" + ], + [ + "&block", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "key?", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "StaticRegisters", + "files": [ + [ + "lib/liquid/static_registers.rb", + 40 + ] + ], + "source": "def key?(key)\n @registers.key?(key) || @static.key?(key)\nend", + "signature": "def key?(key)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "", + "types": [ + "Boolean" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "key", + null + ] + ], + "aliases": [ + + ] + } + ], + "constants": [ + { + "type": "YARD::CodeObjects::ConstantObject", + "name": "UNDEFINED", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "StaticRegisters", + "files": [ + [ + "lib/liquid/static_registers.rb", + 28 + ] + ], + "source": "UNDEFINED = Object.new", + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "value": "Object.new" + } + ], + "instance_attributes": { + "static": { + "read": "Liquid::StaticRegisters#static", + "write": null + } + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "TemplateFactory", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/template_factory.rb", + 4 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "for", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "TemplateFactory", + "files": [ + [ + "lib/liquid/template_factory.rb", + 5 + ] + ], + "source": "def for(_template_name)\n Liquid::Template.new\nend", + "signature": "def for(_template_name)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "_template_name", + null + ] + ], + "aliases": [ + + ] + } + ], + "constants": [ + + ], + "instance_attributes": { + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "StrainerTemplate", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/strainer_template.rb", + 11 + ] + ], + "source": null, + "signature": null, + "docstring": "StrainerTemplate is the computed class for the filters system.\nNew filters are mixed into the strainer class which is then instantiated for each liquid template render run.\n\nThe Strainer only allows method calls defined in filters given to it via StrainerFactory.add_global_filter,\nContext#add_filters or Template.register_filter", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "initialize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "StrainerTemplate", + "files": [ + [ + "lib/liquid/strainer_template.rb", + 12 + ] + ], + "source": "def initialize(context)\n @context = context\nend", + "signature": "def initialize(context)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "a new instance of StrainerTemplate", + "types": [ + "StrainerTemplate" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "context", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "add_filter", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "StrainerTemplate", + "files": [ + [ + "lib/liquid/strainer_template.rb", + 17 + ] + ], + "source": "def add_filter(filter)\n return if include?(filter)\n\n invokable_non_public_methods = (filter.private_instance_methods + filter.protected_instance_methods).select { |m| invokable?(m) }\n if invokable_non_public_methods.any?\n raise MethodOverrideError, \"Filter overrides registered public methods as non public: #{invokable_non_public_methods.join(', ')}\"\n end\n\n include(filter)\n\n filter_methods.merge(filter.public_instance_methods.map(&:to_s))\nend", + "signature": "def add_filter(filter)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "filter", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "invokable?", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "StrainerTemplate", + "files": [ + [ + "lib/liquid/strainer_template.rb", + 30 + ] + ], + "source": "def invokable?(method)\n filter_methods.include?(method.to_s)\nend", + "signature": "def invokable?(method)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "", + "types": [ + "Boolean" + ], + "name": null + } + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "method", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "filter_methods", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "StrainerTemplate", + "files": [ + [ + "lib/liquid/strainer_template.rb", + 36 + ] + ], + "source": "def filter_methods\n @filter_methods ||= Set.new\nend", + "signature": "def filter_methods", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "private", + "scope": "class", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "invoke", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "StrainerTemplate", + "files": [ + [ + "lib/liquid/strainer_template.rb", + 41 + ] + ], + "source": "def invoke(method, *args)\n if self.class.invokable?(method)\n send(method, *args)\n elsif @context.strict_filters\n raise Liquid::UndefinedFilter, \"undefined filter #{method}\"\n else\n args.first\n end\nrescue ::ArgumentError => e\n raise Liquid::ArgumentError, e.message, e.backtrace\nend", + "signature": "def invoke(method, *args)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "method", + null + ], + [ + "*args", + null + ] + ], + "aliases": [ + + ] + } + ], + "constants": [ + + ], + "instance_attributes": { + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "TablerowloopDrop", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/tablerowloop_drop.rb", + 4 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "initialize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "TablerowloopDrop", + "files": [ + [ + "lib/liquid/tablerowloop_drop.rb", + 5 + ] + ], + "source": "def initialize(length, cols)\n @length = length\n @row = 1\n @col = 1\n @cols = cols\n @index = 0\nend", + "signature": "def initialize(length, cols)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "a new instance of TablerowloopDrop", + "types": [ + "TablerowloopDrop" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "length", + null + ], + [ + "cols", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "length", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "TablerowloopDrop", + "files": [ + [ + "lib/liquid/tablerowloop_drop.rb", + 13 + ] + ], + "source": "def length\n @length\nend", + "signature": "def length", + "docstring": "Returns the value of attribute length.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "col", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "TablerowloopDrop", + "files": [ + [ + "lib/liquid/tablerowloop_drop.rb", + 13 + ] + ], + "source": "def col\n @col\nend", + "signature": "def col", + "docstring": "Returns the value of attribute col.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "row", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "TablerowloopDrop", + "files": [ + [ + "lib/liquid/tablerowloop_drop.rb", + 13 + ] + ], + "source": "def row\n @row\nend", + "signature": "def row", + "docstring": "Returns the value of attribute row.", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "index", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "TablerowloopDrop", + "files": [ + [ + "lib/liquid/tablerowloop_drop.rb", + 15 + ] + ], + "source": "def index\n @index + 1\nend", + "signature": "def index", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "index0", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "TablerowloopDrop", + "files": [ + [ + "lib/liquid/tablerowloop_drop.rb", + 19 + ] + ], + "source": "def index0\n @index\nend", + "signature": "def index0", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "col0", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "TablerowloopDrop", + "files": [ + [ + "lib/liquid/tablerowloop_drop.rb", + 23 + ] + ], + "source": "def col0\n @col - 1\nend", + "signature": "def col0", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "rindex", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "TablerowloopDrop", + "files": [ + [ + "lib/liquid/tablerowloop_drop.rb", + 27 + ] + ], + "source": "def rindex\n @length - @index\nend", + "signature": "def rindex", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "rindex0", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "TablerowloopDrop", + "files": [ + [ + "lib/liquid/tablerowloop_drop.rb", + 31 + ] + ], + "source": "def rindex0\n @length - @index - 1\nend", + "signature": "def rindex0", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "first", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "TablerowloopDrop", + "files": [ + [ + "lib/liquid/tablerowloop_drop.rb", + 35 + ] + ], + "source": "def first\n @index == 0\nend", + "signature": "def first", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "last", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "TablerowloopDrop", + "files": [ + [ + "lib/liquid/tablerowloop_drop.rb", + 39 + ] + ], + "source": "def last\n @index == @length - 1\nend", + "signature": "def last", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "col_first", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "TablerowloopDrop", + "files": [ + [ + "lib/liquid/tablerowloop_drop.rb", + 43 + ] + ], + "source": "def col_first\n @col == 1\nend", + "signature": "def col_first", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "col_last", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "TablerowloopDrop", + "files": [ + [ + "lib/liquid/tablerowloop_drop.rb", + 47 + ] + ], + "source": "def col_last\n @col == @cols\nend", + "signature": "def col_last", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "increment!", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "TablerowloopDrop", + "files": [ + [ + "lib/liquid/tablerowloop_drop.rb", + 53 + ] + ], + "source": "def increment!\n @index += 1\n\n if @col == @cols\n @col = 1\n @row += 1\n else\n @col += 1\n end\nend", + "signature": "def increment!", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "protected", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "context=", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Drop", + "files": [ + [ + "lib/liquid/drop.rb", + 26 + ] + ], + "source": "def context=(value)\n @context = value\nend", + "signature": "def context=(value)", + "docstring": "Sets the attribute context", + "dynamic": true, + "tags": [ + { + "tag_name": "param", + "text": "the value to set the attribute context to.", + "types": null, + "name": "value" + } + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + [ + "value", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "liquid_method_missing", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Drop", + "files": [ + [ + "lib/liquid/drop.rb", + 29 + ] + ], + "source": "def liquid_method_missing(method)\n return nil unless @context&.strict_variables\n raise Liquid::UndefinedDropMethod, \"undefined method #{method}\"\nend", + "signature": "def liquid_method_missing(method)", + "docstring": "Catch all for the method", + "dynamic": true, + "tags": [ + { + "tag_name": "raise", + "text": "", + "types": [ + "Liquid::UndefinedDropMethod" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "method", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "invoke_drop", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Drop", + "files": [ + [ + "lib/liquid/drop.rb", + 35 + ] + ], + "source": "def invoke_drop(method_or_key)\n if self.class.invokable?(method_or_key)\n send(method_or_key)\n else\n liquid_method_missing(method_or_key)\n end\nend", + "signature": "def invoke_drop(method_or_key)", + "docstring": "called by liquid to invoke a drop", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "method_or_key", + null + ] + ], + "aliases": [ + "Liquid::Drop#[]" + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "key?", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Drop", + "files": [ + [ + "lib/liquid/drop.rb", + 43 + ] + ], + "source": "def key?(_name)\n true\nend", + "signature": "def key?(_name)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "", + "types": [ + "Boolean" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "_name", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "inspect", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Drop", + "files": [ + [ + "lib/liquid/drop.rb", + 47 + ] + ], + "source": "def inspect\n self.class.to_s\nend", + "signature": "def inspect", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "to_liquid", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Drop", + "files": [ + [ + "lib/liquid/drop.rb", + 51 + ] + ], + "source": "def to_liquid\n self\nend", + "signature": "def to_liquid", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "to_s", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Drop", + "files": [ + [ + "lib/liquid/drop.rb", + 55 + ] + ], + "source": "def to_s\n self.class.name\nend", + "signature": "def to_s", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "[]", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Drop", + "files": [ + [ + "lib/liquid/drop.rb", + 59 + ] + ], + "source": "def invoke_drop(method_or_key)\n if self.class.invokable?(method_or_key)\n send(method_or_key)\n else\n liquid_method_missing(method_or_key)\n end\nend", + "signature": "def invoke_drop(method_or_key)", + "docstring": "called by liquid to invoke a drop", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": null, + "parameters": [ + + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "invokable?", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Drop", + "files": [ + [ + "lib/liquid/drop.rb", + 62 + ] + ], + "source": "def self.invokable?(method_name)\n invokable_methods.include?(method_name.to_s)\nend", + "signature": "def invokable?(method_name)", + "docstring": "Check for method existence without invoking respond_to?, which creates symbols", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "", + "types": [ + "Boolean" + ], + "name": null + } + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "method_name", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "invokable_methods", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "Drop", + "files": [ + [ + "lib/liquid/drop.rb", + 66 + ] + ], + "source": "def self.invokable_methods\n @invokable_methods ||= begin\n blacklist = Liquid::Drop.public_instance_methods + [:each]\n\n if include?(Enumerable)\n blacklist += Enumerable.public_instance_methods\n blacklist -= [:sort, :count, :first, :min, :max]\n end\n\n whitelist = [:to_liquid] + (public_instance_methods - blacklist)\n Set.new(whitelist.map(&:to_s))\n end\nend", + "signature": "def invokable_methods", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + } + ], + "constants": [ + + ], + "instance_attributes": { + "length": { + "read": "Liquid::TablerowloopDrop#length", + "write": null + }, + "col": { + "read": "Liquid::TablerowloopDrop#col", + "write": null + }, + "row": { + "read": "Liquid::TablerowloopDrop#row", + "write": null + } + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + }, + { + "type": "YARD::CodeObjects::ClassObject", + "name": "ParseTreeVisitor", + "namespace_type": "YARD::CodeObjects::ModuleObject", + "namespace_name": "Liquid", + "files": [ + [ + "lib/liquid/parse_tree_visitor.rb", + 4 + ] + ], + "source": null, + "signature": null, + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "class_variables": [ + + ], + "methods": [ + { + "type": "YARD::CodeObjects::MethodObject", + "name": "for", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/parse_tree_visitor.rb", + 5 + ] + ], + "source": "def self.for(node, callbacks = Hash.new(proc {}))\n if defined?(node.class::ParseTreeVisitor)\n node.class::ParseTreeVisitor\n else\n self\n end.new(node, callbacks)\nend", + "signature": "def for(node, callbacks = Hash.new(proc {}))", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "class", + "explicit": true, + "parameters": [ + [ + "node", + null + ], + [ + "callbacks", + "Hash.new(proc {})" + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "initialize", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/parse_tree_visitor.rb", + 13 + ] + ], + "source": "def initialize(node, callbacks)\n @node = node\n @callbacks = callbacks\nend", + "signature": "def initialize(node, callbacks)", + "docstring": "", + "dynamic": true, + "tags": [ + { + "tag_name": "return", + "text": "a new instance of ParseTreeVisitor", + "types": [ + "ParseTreeVisitor" + ], + "name": null + } + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "node", + null + ], + [ + "callbacks", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "add_callback_for", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/parse_tree_visitor.rb", + 18 + ] + ], + "source": "def add_callback_for(*classes, &block)\n callback = block\n callback = ->(node, _) { yield node } if block.arity.abs == 1\n callback = ->(_, _) { yield } if block.arity.zero?\n classes.each { |klass| @callbacks[klass] = callback }\n self\nend", + "signature": "def add_callback_for(*classes, &block)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "*classes", + null + ], + [ + "&block", + null + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "visit", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/parse_tree_visitor.rb", + 26 + ] + ], + "source": "def visit(context = nil)\n children.map do |node|\n item, new_context = @callbacks[node.class].call(node, context)\n [\n item,\n ParseTreeVisitor.for(node, @callbacks).visit(new_context || context),\n ]\n end\nend", + "signature": "def visit(context = nil)", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "public", + "scope": "instance", + "explicit": true, + "parameters": [ + [ + "context", + "nil" + ] + ], + "aliases": [ + + ] + }, + { + "type": "YARD::CodeObjects::MethodObject", + "name": "children", + "namespace_type": "YARD::CodeObjects::ClassObject", + "namespace_name": "ParseTreeVisitor", + "files": [ + [ + "lib/liquid/parse_tree_visitor.rb", + 38 + ] + ], + "source": "def children\n @node.respond_to?(:nodelist) ? Array(@node.nodelist) : []\nend", + "signature": "def children", + "docstring": "", + "dynamic": true, + "tags": [ + + ], + "visibility": "protected", + "scope": "instance", + "explicit": true, + "parameters": [ + + ], + "aliases": [ + + ] + } + ], + "constants": [ + + ], + "instance_attributes": { + }, + "class_attributes": { + }, + "class_mixins": [ + + ], + "instance_mixins": [ + + ] + } +] \ No newline at end of file diff --git a/templates/content/fulldoc/json/setup.rb b/templates/content/fulldoc/json/setup.rb new file mode 100644 index 00000000..bbbf539f --- /dev/null +++ b/templates/content/fulldoc/json/setup.rb @@ -0,0 +1,102 @@ +require 'json' + +# To run this: `yardoc --template-path templates --template content --format json --no-save` + +def init + # I'm honestly not sure why we need to run this, but all other setup.rb files + # have that line. This is a prototype so 🤷‍♂️ + objects = run_verifier(options.objects) + + data = objects.map do |object| + serialize_object(object) + end + + File.write( + "schema.json", + JSON.pretty_generate(data.compact) + ) +end + +def serialize_object(object) + # This diagram is really helpful + # https://github.com/lsegal/yard/blob/main/docs/CodeObjects.md + + if object.class == YARD::CodeObjects::Proxy + # I'm not sure if we should *always* ignore proxy objects. In the case of liquid + # the only proxy objects come from instance mixins where they `include Enumerable` + return nil + end + + # This is data provided by the "Base" class + # Every object contains at least these fields + # There's probably a bunch of stuff in here that we don't care about + data = { + "type" => object.class, + "name" => object.name, + "namespace_type" => object.namespace&.class, + "namespace_name" => object.namespace&.name, + "files" => object.files, + "source" => object.source, + "signature" => object.signature, + "docstring" => object.docstring, + "dynamic" => object.dynamic, + + # This includes some "auto-generated" tags + # eg. `@return` on initialize methods + "tags" => object.tags.map {|tag| serialize_tag(tag)}, + } + + # ClassObject represents... classes that have methods. Duh. + # https://github.com/lsegal/yard/blob/main/lib/yard/code_objects/class_object.rb + if object.class == YARD::CodeObjects::ClassObject + # I decided to exclude children because I *think* it's very similar to method + mixins + # data["children"] = object.children.map {|child| serialize_object(child)} + + # Do we care about this? + data["class_variables"] = object.cvars.map {|class_variable| serialize_object(class_variable)} + + # This includes methods of all visibility. + # I don't know who decided to call this "meths"... but it was an interesting choice + data["methods"] = object.meths.map {|method| serialize_object(method)} + + data["constants"] = object.constants.map {|constant| serialize_object(constant)} + + data["instance_attributes"] = object.instance_attributes + + data["class_attributes"] = object.class_attributes + + # I don't know why we would care about these two things, so I'll + # exclude them from the output for now + # data["class_mixins"] = object.class_mixins.map {|mixin| serialize_object(mixin)} + # data["instance_mixins"] = object.instance_mixins.map {|mixin| serialize_object(mixin)} + end + + # MethodObject represents methods on classes + # https://github.com/lsegal/yard/blob/main/lib/yard/code_objects/method_object.rb + if object.class == YARD::CodeObjects::MethodObject + data["visibility"] = object.visibility + data["scope"] = object.scope + data["explicit"] = object.explicit + data["parameters"] = object.parameters + data["aliases"] = object.aliases + end + + # https://github.com/lsegal/yard/blob/main/lib/yard/code_objects/constant_object.rb + if object.class == YARD::CodeObjects::ConstantObject + data["value"] = object.value + end + + return data +end + +def serialize_tag(tag) + # Docs: https://github.com/lsegal/yard/blob/359006641260eef1fe6d28f5c43c7c98d40f257d/docs/Tags.md + # Class: https://github.com/lsegal/yard/blob/main/lib/yard/tags/tag.rb + + { + "tag_name" => tag.tag_name, + "text" => tag.text, + "types" => tag.types, + "name" => tag.name + } +end \ No newline at end of file