G
George Moschovitis
Hello everyone,
I am wondering if the following is possible in Ruby:
class Source
def my_method
puts 'IT WORKS'
end
end
class Dest
# no method
end
inject_method(Source, :my_method, Dest)
d = Dest.new
d.my_method # => IT WORKS
Is it possible to write 'inject_method' in Ruby ?
Thanks in advance,
George
I am wondering if the following is possible in Ruby:
class Source
def my_method
puts 'IT WORKS'
end
end
class Dest
# no method
end
inject_method(Source, :my_method, Dest)
d = Dest.new
d.my_method # => IT WORKS
Is it possible to write 'inject_method' in Ruby ?
Thanks in advance,
George