Module: Dentaku

Defined in:
lib/dentaku.rb,
lib/dentaku/token.rb,
lib/dentaku/parser.rb,
lib/dentaku/ast/nil.rb,
lib/dentaku/version.rb,
lib/dentaku/ast/case.rb,
lib/dentaku/ast/node.rb,
lib/dentaku/tokenizer.rb,
lib/dentaku/ast/string.rb,
lib/dentaku/calculator.rb,
lib/dentaku/exceptions.rb,
lib/dentaku/ast/literal.rb,
lib/dentaku/ast/logical.rb,
lib/dentaku/ast/numeric.rb,
lib/dentaku/ast/function.rb,
lib/dentaku/ast/grouping.rb,
lib/dentaku/ast/negation.rb,
lib/dentaku/ast/operation.rb,
lib/dentaku/token_matcher.rb,
lib/dentaku/token_scanner.rb,
lib/dentaku/ast/arithmetic.rb,
lib/dentaku/ast/identifier.rb,
lib/dentaku/token_matchers.rb,
lib/dentaku/ast/combinators.rb,
lib/dentaku/ast/comparators.rb,
lib/dentaku/ast/functions/if.rb,
lib/dentaku/ast/case/case_else.rb,
lib/dentaku/ast/case/case_then.rb,
lib/dentaku/ast/case/case_when.rb,
lib/dentaku/dependency_resolver.rb,
lib/dentaku/bulk_expression_solver.rb,
lib/dentaku/ast/case/case_conditional.rb,
lib/dentaku/ast/case/case_switch_variable.rb,
lib/dentaku/ast/functions/string_functions.rb

Defined Under Namespace

Modules: AST, TokenMatchers Classes: ArgumentError, BulkExpressionSolver, Calculator, DependencyResolver, ParseError, Parser, Token, TokenMatcher, TokenScanner, Tokenizer, UnboundVariableError, ZeroDivisionError

Constant Summary collapse

VERSION =
"2.0.8"

Class Method Summary collapse

Class Method Details

.cache_ast?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/dentaku.rb', line 22

def self.cache_ast?
  @enable_ast_caching
end

.cache_dependency_order?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/dentaku.rb', line 30

def self.cache_dependency_order?
  @enable_dependency_order_caching
end

.enable_ast_cache!Object



18
19
20
# File 'lib/dentaku.rb', line 18

def self.enable_ast_cache!
  @enable_ast_caching = true
end

.enable_caching!Object



13
14
15
16
# File 'lib/dentaku.rb', line 13

def self.enable_caching!
  enable_ast_cache!
  enable_dependency_order_cache!
end

.enable_dependency_order_cache!Object



26
27
28
# File 'lib/dentaku.rb', line 26

def self.enable_dependency_order_cache!
  @enable_dependency_order_caching = true
end

.evaluate(expression, data = {}) ⇒ Object



9
10
11
# File 'lib/dentaku.rb', line 9

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