module Stringento

Top-level API for main external consumption. It is better to use this than instantiating your own Template objects because this top-level object will cache Template objects based on the expression. It also provides less default resolver and formatter instantiations.

Copyright © 2019-present, Blue Marble Payroll, LLC

This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.

Copyright © 2019-present, Blue Marble Payroll, LLC

This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.

Copyright © 2019-present, Blue Marble Payroll, LLC

This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.

Copyright © 2019-present, Blue Marble Payroll, LLC

This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.

Copyright © 2019-present, Blue Marble Payroll, LLC

This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.

Constants

VERSION

Public Class Methods

evaluate(expression, input, resolver: nil, formatter: nil) click to toggle source
# File lib/stringento.rb, line 20
def evaluate(expression, input, resolver: nil, formatter: nil)
  template(expression).evaluate(
    input,
    resolver: (resolver || default_resolver),
    formatter: (formatter || default_formatter)
  )
end

Private Class Methods

default_formatter() click to toggle source
# File lib/stringento.rb, line 42
def default_formatter
  @default_formatter ||= Formatter.new
end
default_resolver() click to toggle source
# File lib/stringento.rb, line 38
def default_resolver
  @default_resolver ||= Resolver.new
end
template(expression) click to toggle source
# File lib/stringento.rb, line 34
def template(expression)
  templates[expression.to_s] ||= Template.new(expression)
end
templates() click to toggle source
# File lib/stringento.rb, line 30
def templates
  @templates ||= {}
end