Sha256: f7a6d0ef535228cf3344889906a4ce55ed678ac3e065b7beef2895451b060b2d

Contents?: true

Size: 523 Bytes

Versions: 2

Compression:

Stored size: 523 Bytes

Contents

require "bigdecimal"
require "dentaku/calculator"
require "dentaku/version"

module Dentaku
  def self.evaluate(expression, data={})
    calculator.evaluate(expression, data)
  end

  class UnboundVariableError < StandardError
    attr_reader :unbound_variables

    def initialize(unbound_variables)
      @unbound_variables = unbound_variables
    end
  end

  private

  def self.calculator
    @calculator ||= Dentaku::Calculator.new
  end
end

def Dentaku(expression, data={})
  Dentaku.evaluate(expression, data)
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dentaku-1.2.0 lib/dentaku.rb
dentaku-1.1.0 lib/dentaku.rb