Method: Eqn::Terminal::Variable#value

Defined in:
lib/eqn/terminal.rb

#value(vars = {}) ⇒ Object



5
6
7
8
9
10
11
# 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