module ActiveRecord::Core

def slice(*methods)

Returns a hash of the given methods with their names as keys and returned values as values.
def slice(*methods)
  methods.flatten.index_with { |method| public_send(method) }.with_indifferent_access
end