app/models/concerns/templatable.rb
# Takes the current template context and generates an interpolated value based on that context.
#
# @param object [Object] the string, collection, or hash into which you wish to interpolate the current context
# @return [Object] the string, collection, or hash filled in with the interpolated values from the current context
Takes the current template context and generates an interpolated value based on that context.
Takes the current template context and generates an interpolated value based on that context .
def template_object(object)
    case object
    when String
      template_string(object)
    when Hash
      object.each_with_object({}.with_indifferent_access) { |(key, value), memo| memo[key] = template_object(value) }
    when Enumerable
      object.map { |value| template_object(value) }
    else
      object
    end
  end
def template_object ( object ) case object when String template_string ( object ) when Hash object . each_with_object ( { } . with_indifferent_access ) { | ( key , value ) , memo | memo [ key ] = template_object ( value ) } when Enumerable object . map { | value | template_object ( value ) } else object end end
Takes the current template context and generates an interpolated value based on that context.
Takes the current template context and generates an interpolated value based on that context .
the string, collection, or hash filled in with the interpolated values from the current context
the string collection or hash filled in with the interpolated values from the current context
Object
object
the string, collection, or hash into which you wish to interpolate the current context
the string collection or hash into which you wish to interpolate the current context