E
Erwin Abbott
Hi
I've written a number of classes which would benefit from the
Enumerable mixin, but my #each method requires arguments. These are
usually to specify the range of values, like Fibonacci#each(first,
last) or whatever. Since Enumerable's #map, #collect, etc don't take
arguments, how should I proceed? I would be okay with wrapping the
Enumerable methods I need, but that doesn't seem possible. Do I just
have to implement my own #map, #to_a, etc?
Thanks,
Erwin
I've written a number of classes which would benefit from the
Enumerable mixin, but my #each method requires arguments. These are
usually to specify the range of values, like Fibonacci#each(first,
last) or whatever. Since Enumerable's #map, #collect, etc don't take
arguments, how should I proceed? I would be okay with wrapping the
Enumerable methods I need, but that doesn't seem possible. Do I just
have to implement my own #map, #to_a, etc?
Thanks,
Erwin