Skip to content

Commit

Permalink
minor changes on readme
Browse files Browse the repository at this point in the history
  • Loading branch information
danielribeiro committed Nov 7, 2010
1 parent e9ba7bd commit 4218520
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions README.md
Expand Up @@ -14,14 +14,15 @@ However, as you decompose more and more your iterations into a sequence of
[reduces](http://ruby-doc.org/core-1.8.7/classes/Enumerable.html#M001148), more commonly
you see simple blocks such as:

collection.map { |x| x.invoke }

dates.select { |d| d.greater_than(old_date) }
collection.map { |x| x.invoke }
classes.reject { |c| c.subclasses.include?(Array) }

RubyUnderscore modify classes so that you can also use a short notation for simple closures. With such, the above examples can be written as:

collection.map _.invoke

dates.select _.greater_than old_date
collection.map _.invoke
classes.reject _.subclasses.include? Array

Just replace the iterating argument with the underscore symbol (*_*), and ditch the
Expand Down

0 comments on commit 4218520

Please sign in to comment.