D
DrBenway
hi all,
I'm a ruby noop trying his first steps. I'd like a little advice.
What I want to make is the following.
An object Chicken
- its attribute starts as 'egg'
- after x times sleep() it the attribute gets the value chicken
- x times sleep later the object can make a call to make a new
instance of chicken (creating another egg)
I could make a method to change the attribute and call this from my
main program.
In other words my sleep method would be in my main program and call
the objects method.
I was wondering if it would be possible to keep the sleep in the
object.
(Since I was planning on creating some other animals as well, each
with a special amount of time needed to go to the next step.)
I think it's called threads in ruby but I'm not sure. (if it's called
threads is this the way to handle this problem? Does it act like an
Ajax call?)
Many thnx
DrBenway
I'm a ruby noop trying his first steps. I'd like a little advice.
What I want to make is the following.
An object Chicken
- its attribute starts as 'egg'
- after x times sleep() it the attribute gets the value chicken
- x times sleep later the object can make a call to make a new
instance of chicken (creating another egg)
I could make a method to change the attribute and call this from my
main program.
In other words my sleep method would be in my main program and call
the objects method.
I was wondering if it would be possible to keep the sleep in the
object.
(Since I was planning on creating some other animals as well, each
with a special amount of time needed to go to the next step.)
I think it's called threads in ruby but I'm not sure. (if it's called
threads is this the way to handle this problem? Does it act like an
Ajax call?)
Many thnx
DrBenway