tags.map(&:name.to_proc).Same as short join(' ')
Can be written when foo
is an object with the to_proc
method, and
Handing over the factor with &foo
is the same as handing over the result of calling foo.to_proc
to the factor.
class Symbol
def to_proc
Proc.new do |obj, *args|
obj.send self, *args
end
end
end
© 2024 OneMinuteCode. All rights reserved.