tario/define_method_handler — Issue #8: Anonymous, of easy creation and inherited chains
Author: tario
Created: 2012-02-12 22:30:12+00:00
State: open

class X
define_method_handler(:foo) { |a|
a == 4 ? 3 : ignore
}
end

chain = define_chain(X).handler(:foo){|a|
if a == 3
a+1
else
ignore
end
}.handler(:foo){|a|
chain.foo(a-1)
}.new

define_chain should return an anonymous class