On Mon, Apr 21, 2008 at 12:49 PM, Martin Vales <martin / opengeomap.org> wrote:
>
>  Someone know like connect a signal inside a class??
>  I am working in ruby gnome, but i thinkl this is a ruby generic
>  question.
>
I have no idea what Gnome really needs but the doc is pretty good IIRC.
>  class One
>   def initialize(callback)
>    callback
>   end
>
>  end
>
>  class Main
>   def initialize
>    One.new("talk_with_me")
>   end
>
>   def talk_with_me
>    puts "i am here"
>   end
>
>  end
>
>
>
>  thanks in advance.
>  --
>  Posted via http://www.ruby-forum.com/.
>
>

You could do different things, e.g. call a proc or instance_eval a
block, as I suspect that you need information of the class I would
rather instance_eval.

class Two
   def initialize &blk
     instance_eval &blk
   end
   def say_hello; puts "hello" end
end

Two.new do say_hello end

HTH
Robert
-- 
http://ruby-smalltalk.blogspot.com/

---
Whereof one cannot speak, thereof one must be silent.
Ludwig Wittgenstein