Eric Li

27%
Flag icon
The ampersand works in the other direction, too. If we have a Proc object in a variable and we want to pass it to a method that is looking for a code block, we can convert the Proc object back into a code block by sticking an ampersand in front of it:
Design Patterns in Ruby (Addison-Wesley Professional Ruby Series)
Rate this book
Clear rating
Open Preview