Class: Liquid2::Empty

Inherits:
Expression show all
Defined in:
lib/liquid2/expressions/blank.rb

Overview

The special value empty.

Instance Attribute Summary

Attributes inherited from Expression

#token

Instance Method Summary collapse

Methods inherited from Expression

#children, #initialize, #scope

Constructor Details

This class inherits a constructor from Liquid2::Expression

Instance Method Details

#==(other) ⇒ Object Also known as: eql?



31
32
33
34
35
# File 'lib/liquid2/expressions/blank.rb', line 31

def ==(other)
  return other.empty? if other.respond_to?(:empty?)

  other.is_a?(Empty)
end

#evaluate(_context) ⇒ Object



27
28
29
# File 'lib/liquid2/expressions/blank.rb', line 27

def evaluate(_context)
  self
end

#to_sObject



39
# File 'lib/liquid2/expressions/blank.rb', line 39

def to_s = ""