Class: FilterParam::AST::Expressions::Expression

Inherits:
Node
  • Object
show all
Defined in:
lib/filter_param/ast/expressions.rb

Direct Known Subclasses

BinaryExpression, UnaryExpression

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#accept

Constructor Details

#initialize(operator, *operands) ⇒ Expression

Returns a new instance of Expression.



7
8
9
10
11
12
# File 'lib/filter_param/ast/expressions.rb', line 7

def initialize(operator, *operands)
  super()

  @operator = operator.to_sym
  @operands = operands
end

Instance Attribute Details

#operandsObject (readonly)

Returns the value of attribute operands.



5
6
7
# File 'lib/filter_param/ast/expressions.rb', line 5

def operands
  @operands
end

#operatorObject (readonly)

Returns the value of attribute operator.



5
6
7
# File 'lib/filter_param/ast/expressions.rb', line 5

def operator
  @operator
end