Class: JSONP3::LogicalOrExpression

Inherits:
InfixExpression show all
Defined in:
lib/json_p3/filter.rb

Overview

A logical || expression.

Instance Attribute Summary

Attributes inherited from InfixExpression

#left, #right

Attributes inherited from Expression

#token

Instance Method Summary collapse

Methods inherited from InfixExpression

#==, #hash, #initialize

Methods inherited from Expression

#initialize

Constructor Details

This class inherits a constructor from JSONP3::InfixExpression

Instance Method Details

#evaluate(context) ⇒ Object



213
214
215
# File 'lib/json_p3/filter.rb', line 213

def evaluate(context)
  JSONP3.truthy?(@left.evaluate(context)) || JSONP3.truthy?(@right.evaluate(context))
end

#to_sObject



217
218
219
# File 'lib/json_p3/filter.rb', line 217

def to_s
  "#{@left} || #{@right}"
end