instance method
slice
Ruby on Rails 6.0.6
Since v4.0.13Signature
slice(*methods)
Returns a hash of the given methods with their names as keys and returned values as values.
Parameters
-
methodsrest
Source
# File activerecord/lib/active_record/core.rb, line 560
def slice(*methods)
Hash[methods.flatten.map! { |method| [method, public_send(method)] }].with_indifferent_access
end
Defined in activerecord/lib/active_record/core.rb line 560
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::Core