Extending the Threads Class

  • Thread starter Demonic Software
  • Start date
D

Demonic Software

Hello,

I was wondering if someone could help me with extending the Threads
class. I am trying to do something like the following

Code:
class foo < Thread
def run
puts 'Here I am, over here! uuh, uuh me, pick me!'
another_method()
end
def another_method()
puts 'Something interesting'
end
end


t = foo.new()
t.start()

The behavior I expect is foo.start() will call foo.run(). I have been
trying to figure this out for a few hours, and I have not had any luck.
I am mostly a Python programmer, and I am applying what I have learned
in that language.


Thanks in advance.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,968
Messages
2,570,150
Members
46,697
Latest member
AugustNabo

Latest Threads

Top