Class: Eqn::Terminal::Op

Inherits:
EqnNode
  • Object
show all
Defined in:
lib/eqn/terminal.rb

Overview

Node class for an operator.

Direct Known Subclasses

LeftAssociativeOp, RightAssociativeOp

Defined Under Namespace

Classes: LeftAssociativeOp, RightAssociativeOp

Instance Method Summary collapse

Methods inherited from EqnNode

#clean_tree!, #term?

Instance Method Details

#left_associative?Boolean



30
31
32
# File 'lib/eqn/terminal.rb', line 30

def left_associative?
  is_a?(LeftAssociativeOp)
end

#value(_vars = {}) ⇒ Object



34
35
36
# File 'lib/eqn/terminal.rb', line 34

def value(_vars = {})
  text_value == '^' ? :** : text_value.to_sym
end