Class: JSONP3::Path::LogicalOrExpression

Inherits:
InfixExpression show all
Defined in:
lib/json_p3/path/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::Path::InfixExpression

Instance Method Details

#evaluate(context) ⇒ Object



215
216
217
# File 'lib/json_p3/path/filter.rb', line 215

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

#to_sObject



219
220
221
# File 'lib/json_p3/path/filter.rb', line 219

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