Actions
Feature #12523
open`Object#values_at`
Status:
Open
Assignee:
-
Target version:
-
Description
It might be convenient to have a method that returns multiple attributes of an object.
class A
attr_accessors :foo, :bar, :baz
def initialize foo, bar, baz; @foo, @bar, @baz = foo, bar, baz end
end
a = A.new("a", "b", "c")
a.values_at(:baz, :foo) # => ["c", "a"]
Updated by shyouhei (Shyouhei Urabe) over 8 years ago
I'm not that strongly against it, but wonder if it has actual usage where it is convenient. Do you have any use cases?
Actions
Like0
Like0Like0