class Eqn::Terminal::Variable

Node class for a variable.

Public Instance Methods

value(vars = {}) click to toggle source
# File lib/eqn/terminal.rb, line 5
def value(vars = {})
  val = vars[text_value.to_sym]
  raise NoVariableValueError, "No value given for: #{text_value}" unless val
  raise NonNumericVariableError, "Variable #{text_value} value is nonnumeric: #{val}" unless val.is_a?(Numeric)

  val
end