Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
How are methods being excecuted?
Saladin Mundi
12/5/2007 10:50:00 AM
Hi everyone,
I'm working on a method which should manipulate the excecution of the
method body.
Therefore I need to know, how/where a Ruby method is called and
how/where the method body is excecuted. Its all done on the C-level of
Ruby.
If we have something like:
class z
def x()
k = "John"
puts "Hello #{k}"
end
end
t = z.new.x
I found out, that rb_call/rb_funcall have something to do with the
execution of a method. But they are only calling the internal C-methods.
So the ID mid from rb_call(VALUE klass, VALUE recv, ID mid, int argc,
const VALUE *argv, int scope) refers C-Methods but not also to my method
x.
So I don't know how to recognize when my (Ruby) method x is called.
Additionally I don't know which C-Method really executes (not calls) my
method x. So which method goes through the method body of x and makes
the setting of the local variable k and the forwarding of the string
Hello... to the method puts.
It would be so helpful if someone has got tips for me
thanks in advance
sala
--
Posted via
http://www.ruby-...
.
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
How are methods being excecuted?
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password