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.



367
368
369
# File 'lib/active_record/core.rb', line 367

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