Class: JSONP3::Path::LeExpression

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

Instance Method Details

#evaluate(context) ⇒ Object



248
249
250
251
252
# File 'lib/json_p3/path/filter.rb', line 248

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

#to_sObject



254
255
256
# File 'lib/json_p3/path/filter.rb', line 254

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