def object_substitute_tokens(object, attributes)
      unmatched_tokens = []
      case object
      when Hash
        object.each do |key, value|
          object[key], unmatched = object_substitute_tokens(value, attributes)
          unmatched_tokens.push(*unmatched)
        end
      when Array
        object.map! do |value|
          value, unmatched = object_substitute_tokens(value, attributes)
          unmatched_tokens.push(*unmatched)
          value
        end
      when String
        object, unmatched_tokens = substitute_tokens(object, attributes)
      end
      [object, unmatched_tokens.uniq]
    end
def object_substitute_tokens(object, attributes)
      unmatched_tokens = []
      case object
      when Hash
        object.each do |key, value|
          object[key], unmatched = object_substitute_tokens(value, attributes)
          unmatched_tokens.push(*unmatched)
        end
      when Array
        object.map! do |value|
          value, unmatched = object_substitute_tokens(value, attributes)
          unmatched_tokens.push(*unmatched)
          value
        end
      when String
        object, unmatched_tokens = substitute_tokens(object, attributes)
      end
      [object, unmatched_tokens.uniq]
    end
Perform token substitution for an object. String values are
 passed to `substitute_tokens()`, arrays and sub-hashes are
 processed recursively. Numeric values are ignored.

 @param object [Object]
 @param attributes [Hash]
 @return	[Array] containing the updated object with substituted
   values and an array of unmatched tokens.