root/branches/1_5/sample/howto/scopesample/servant.rb
| Revision 1843, 202 bytes (checked in by nahi, 2 years ago) | |
|---|---|
| |
| Line | |
|---|---|
| 1 | class Servant |
| 2 | def self.create |
| 3 | new |
| 4 | end |
| 5 | |
| 6 | def initialize |
| 7 | STDERR.puts "Servant created." |
| 8 | @task = [] |
| 9 | end |
| 10 | |
| 11 | def push(value) |
| 12 | @task.push(value) |
| 13 | end |
| 14 | |
| 15 | def pop |
| 16 | @task.pop |
| 17 | end |
| 18 | end |
Note: See TracBrowser for help on using the browser.