class Liquid::Condition

Overview

Container for liquid nodes which conveniently wraps decision making logic

Example:

c = Condition.new("1", "==", "1") c.evaluate #=> true

Direct Known Subclasses

Defined in:

liquid/condition.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(left = nil, operator = nil, right = nil) #

[View source]

Instance Method Detail

def and(condition) #

[View source]
def attach(attachment : Nil | Array(Liquid::Tag | Liquid::Variable | String)) #

[View source]
def attachment : Array(Liquid::Tag | Liquid::Variable | String)? #

[View source]
def else? #

[View source]
def evaluate(context = Context.new) #

[View source]
def inspect #
Description copied from class Object

Returns an unambiguous and information-rich string representation of this object, typically intended for developers.

This method should usually not be overridden. It delegates to #inspect(IO) which can be overridden for custom implementations.

Also see #to_s.


[View source]
def left : Type #

[View source]
def left=(left : Type) #

[View source]
def operator : String | Nil #

[View source]
def operator=(operator : String | Nil) #

[View source]
def or(condition) #

[View source]
def right : Type #

[View source]
def right=(right : Type) #

[View source]