Ola Bini wrote:
> Hi,
> 
> I'm looking for a way to copy methods from a Module, or specify more
> directly which methods get included in a class. More or less, I would
> like to be able to do something like this:
>
> <snip /> 
>
> module Baz
>    append_from Foo, :do_second, :do_third
> end
> 
> and I would have a module Baz which could be included, without having
> do_one_thing included.
> 
> Is this possible in Ruby right now? My first approach was to get the
> UnboundMethod instance_method from the Module, but I couldn't find a way
> to attach these to an unrelated class since UnboundMethod must have a
> is_a?-relationship with the binding object.

I think the 'proper' solution is to chop your module into
smaller pieces. Alternatively, Method#to_proc, maybe?

> Regards


-- 
Posted via http://www.ruby-forum.com/.