class MarkMapper::Normalizers::CriteriaHashKey

Public Instance Methods

call(key) click to toggle source

Public: Returns key normalized for MarkLogic

key - The key to normalize

Returns key as Symbol if possible, else key with no changes

# File lib/mark_mapper/normalizers/criteria_hash_key.rb, line 9
def call(key)
  key = key.to_sym       if key.respond_to?(:to_sym)
  return call(key.field) if key.respond_to?(:field)
  return :_id            if key == :id
  key
end