GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Rubygem
Description: Implements pattern-based method dispatch for Ruby, inspired by Topher Cyll's multi.
Clone URL: git://github.com/dyoder/functor.git
changed to check for #call instead of Proc
dyoder (author)
Fri Sep 05 06:37:22 -0700 2008
commit  d181123a96ef41cbc561d6b4631f48787c06a3ae
tree    4a3e16965c313e3359b463acf8b3f46aad22811d
parent  601aa5b974f9e1d293fdeedf41178def5c3e4bed
...
63
64
65
66
 
67
68
69
...
63
64
65
 
66
67
68
69
0
@@ -63,7 +63,7 @@ class Functor
0
   end
0
   
0
   def pair?( arg, rule )
0
- ( rule.is_a?( Proc ) and rule.call( arg ) ) or rule === arg or rule == arg
0
+ ( rule.respond_to? :call and rule.call( arg ) ) or rule === arg or rule == arg
0
   end
0
   
0
   def argument_error( args )

Comments

    No one has commented yet.