1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-03 23:28:02 +00:00

Fix a typo in the name of the latest til file.

This commit is contained in:
jbranchaud
2015-07-28 21:32:09 -05:00
parent a9dcbe303c
commit 1e4ddfc8b0

View File

@@ -0,0 +1,15 @@
# Passing Arbitrary Methods As Blocks
Use
[`Object#method`](http://ruby-doc.org/core-1.8.7/Object.html#method-i-method)
to create a callable `Method` object that can be passed to methods
that yield to a block.
```ruby
def inc(x)
x + 1
end
[1,2,3].map(&method(:inc))
#=> [2,3,4]
```