How are methods being excecuted?

Discussion in 'Ruby' started by Saladin Mundi, Dec 5, 2007.

  1. 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-forum.com/.
     
    Saladin Mundi, Dec 5, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?TWFyayBQYXJ0ZXI=?=

    Form still being submitted despite being invalid

    =?Utf-8?B?TWFyayBQYXJ0ZXI=?=, Jul 25, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    624
  2. Learner
    Replies:
    5
    Views:
    652
    Karl Seguin
    Dec 21, 2005
  3. Replies:
    14
    Views:
    520
    John W. Kennedy
    Oct 17, 2007
  4. Kenneth McDonald
    Replies:
    5
    Views:
    345
    Kenneth McDonald
    Sep 26, 2008
  5. Moshe Katz
    Replies:
    2
    Views:
    153
    Moshe Katz
    May 2, 2004
Loading...

Share This Page