Sha256: 4c76f3fbe6fca513e98aa9baa191da19cf0b29335dec51117bc74afad3efbb58
Contents?: true
Size: 1.06 KB
Versions: 3
Compression:
Stored size: 1.06 KB
Contents
require "bigdecimal" require "dentaku/calculator" require "dentaku/version" module Dentaku @enable_ast_caching = false @enable_dependency_order_caching = false @aliases = {} def self.evaluate(expression, data = {}) calculator.evaluate(expression, data) end def self.evaluate!(expression, data = {}) calculator.evaluate!(expression, data) end def self.enable_caching! enable_ast_cache! enable_dependency_order_cache! end def self.enable_ast_cache! @enable_ast_caching = true end def self.cache_ast? @enable_ast_caching end def self.enable_dependency_order_cache! @enable_dependency_order_caching = true end def self.cache_dependency_order? @enable_dependency_order_caching end def self.aliases @aliases end def self.aliases=(hash) @aliases = hash end private def self.calculator @calculator ||= Dentaku::Calculator.new end end def Dentaku(expression, data = {}) Dentaku.evaluate(expression, data) end def Dentaku!(expression, data = {}) Dentaku.evaluate!(expression, data) end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
dentaku-3.3.1 | lib/dentaku.rb |
dentaku-3.3.0 | lib/dentaku.rb |
dentaku-3.2.1 | lib/dentaku.rb |