./README in methodchain-0.0.5 vs ./README in methodchain-0.1.0
- old
+ new
@@ -5,19 +5,19 @@
== Author and License
Copyright (c) 2008 Greg Weber, http://gregweber.info
Licensed under the MIT license
== Example
-= tap
+==== tap
if you don't already know about this method, look it up on the net. The tap included here allows message sending.
OLD WAY (still valid with this tap)
[1].tap {|arr| arr.compact!}.first # => 1
NEW WAY
[1].tap(:compact!).first # => 1
-= #then and #else
+==== #then and #else
OLD WAY
name = person ? person.name : nil
NEW WaY
name = person.then {|p| p.name}
@@ -56,19 +56,17 @@
require 'methodchain'
=== selectively import MethodChain methods
-then_else will load just the then and else methods and not the tap method
+ require 'methodchain/not_included'
- require 'methodchain/then_else'
-
not_included will load the MethodChain module without including it anywhere.
+Already have your own version of tap? use the module-import gem to decide what to include
- require 'methodchain/not_included'
-
== Implementation
-a helper method called self_eval is also exposed. This method allows the two different block forms {|p| p.name} and {name}, where the second form is called using instance_eval.
+* There are no proxy objects, these are simply function calls, so it should be fast.
+* A helper method called self_eval is also exposed. This method allows the two different block forms {|p| p.name} and {name}, where the second form is called using instance_eval.
== Install
gem install methodchain
== Source