Class: Oso::Polar::Expression

Inherits:
Object
  • Object
show all
Defined in:
lib/oso/polar/expression.rb

Overview

Polar expression.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(operator, args) ⇒ Expression

Returns a new instance of Expression.

Parameters:

  • operator (String)
  • args (Array<Object>)


11
12
13
14
# File 'lib/oso/polar/expression.rb', line 11

def initialize(operator, args)
  @operator = operator
  @args = args
end

Instance Attribute Details

#argsObject

Returns the value of attribute args.



7
8
9
# File 'lib/oso/polar/expression.rb', line 7

def args
  @args
end

#operatorObject

Returns the value of attribute operator.



7
8
9
# File 'lib/oso/polar/expression.rb', line 7

def operator
  @operator
end

Instance Method Details

#==(other) ⇒ Boolean Also known as: eql?

Parameters:

Returns:

  • (Boolean)


18
19
20
# File 'lib/oso/polar/expression.rb', line 18

def ==(other)
  operator == other.operator && args == other.args
end