method

slice

Importance_1
Ruby on Rails latest stable (v7.1.3.2) - 0 notes - Class: Core
slice public

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

topic = Topic.new(title: "Budget", author_name: "Jason")
topic.slice(:title, :author_name)
=> { "title" => "Budget", "author_name" => "Jason" }
Show source
Register or log in to add new notes.