Class: Liquid2::Blank
- Inherits:
-
Expression
- Object
- Expression
- Liquid2::Blank
- Defined in:
- lib/liquid2/expressions/blank.rb
Overview
The special value blank.
Instance Attribute Summary
Attributes inherited from Expression
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #evaluate(_context) ⇒ Object
- #to_s ⇒ Object
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?
12 13 14 15 16 17 18 |
# File 'lib/liquid2/expressions/blank.rb', line 12 def ==(other) return true if other.is_a?(String) && (other.empty? || other.match?(/\A\s+\Z/)) return other.empty? if other.respond_to?(:empty?) other.is_a?(Blank) end |
#evaluate(_context) ⇒ Object
8 9 10 |
# File 'lib/liquid2/expressions/blank.rb', line 8 def evaluate(_context) self end |
#to_s ⇒ Object
22 |
# File 'lib/liquid2/expressions/blank.rb', line 22 def to_s = "" |