Method: ActiveRecord::Core#slice

Defined in:
lib/active_record/core.rb

#slice(*methods) ⇒ Object

Returns a hash of the given methods with their names as keys and returned values as values.



538
539
540
# File 'lib/active_record/core.rb', line 538

def slice(*methods)
  Hash[methods.flatten.map! { |method| [method, public_send(method)] }].with_indifferent_access
end