Liquid::Context
Inherits Reference / Object
A Context object provides the variables used by the Template object. These variables are stored
as key-value pairs of type String, Liquid::Any.
Constructors
Creates a new Context with the given error_mode and data.
Instance methods
Returns the value for the variable given by var, or nil if the variable isn't found.
This doesn't trigger any exceptions or store any errors if the variable doesn't exists.
Fetch a variable from context, add UndefinedVariable error if the variable isn't found and behave according the
error mode.
Sets the value for var to an instance of Liquid::Any generated from value.
Set the contents of a JSON::Any to the context.
NOTE: You need to require "liquid/json" to use this method.
Appends a short String representation of this object which includes its class name and its object address.
class Person
def initialize(@name : String, @age : Int32)
end
end
Person.new("John", 32).to_s # => #<Person:0x10a199f20>