class Belir::Equation

Represents an Equation with one output and multiple input values

Attributes

inputs[R]
output[R]

Public Class Methods

new(output, *inputs, &block) click to toggle source
# File lib/belir.rb, line 9
def initialize(output, *inputs, &block)
  @output = output
  @inputs = inputs
  @lambda = block
end

Public Instance Methods

calculate(*inputs) click to toggle source
# File lib/belir.rb, line 15
def calculate(*inputs)
  # Note the splat (*inputs) to convert [2] => 2
  @lambda.call(*inputs)
end