class Locomotive::Steam::Liquid::Filters::Number::NumberProxyHelper

Public Class Methods

new(name, context) click to toggle source
# File lib/locomotive/steam/liquid/filters/number.rb, line 27
def initialize(name, context)
  @name     = name
  @context  = context
end

Public Instance Methods

interpolate_options(options) click to toggle source
# File lib/locomotive/steam/liquid/filters/number.rb, line 36
def interpolate_options(options)
  (options || {}).transform_values do |option|
    if option.is_a?(String)
      _option = ::Liquid::Expression.parse(option)
      @context.evaluate(_option) || option
    else
      option
    end
  end
end
invoke(input, options) click to toggle source
# File lib/locomotive/steam/liquid/filters/number.rb, line 32
def invoke(input, options)
  send :"number_to_#{@name}", input, interpolate_options(options)
end