lib/liquid_dynamic_context/variable_finder.rb
# Extracts all used variables from a liquid template.
#
# @param template_string [String] a string with a valid liquid template
#
# @return [Enumerable<Symbol>] an enumerable with the variables found in the template, the variables
#   are represented as symbols
Extracts all used variables from a liquid template.
Extracts all used variables from a liquid template .
def variable_lookups(parsed_template)
      Liquid::ParseTreeVisitor.for(parsed_template.root)
                              .add_callback_for(Liquid::VariableLookup) do |node|
        [node.name, *node.lookups].join(".")
      end
                              .visit
    end
def variable_lookups ( parsed_template ) Liquid :: ParseTreeVisitor . for ( parsed_template . root ) . add_callback_for ( Liquid :: VariableLookup ) do | node | [ node . name , * node . lookups ] . join ( "." ) end . visit end
Extracts all used variables from a liquid template.
Extracts all used variables from a liquid template .
an enumerable with the variables found in the template, the variables are represented as symbols
an enumerable with the variables found in the template the variables are represented as symbols
Enumerable<Symbol>
parsed_template
<not_specific>
template_string
<not_specific>
a string with a valid liquid template
a string with a valid liquid template