Class: JSONP3::LeExpression

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

Overview

A <= 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



246
247
248
249
250
# File 'lib/json_p3/filter.rb', line 246

def evaluate(context)
  left = @left.evaluate(context)
  right = @right.evaluate(context)
  JSONP3.eq?(left, right) || JSONP3.lt?(left, right)
end

#to_sObject



252
253
254
# File 'lib/json_p3/filter.rb', line 252

def to_s
  "#{@left} <= #{@right}"
end