root/trunk/sample/basic/calc/calc.rb
| Revision 1843, 208 bytes (checked in by nahi, 2 years ago) | |
|---|---|
| |
| Line | |
|---|---|
| 1 | module CalcService |
| 2 | def self.add(lhs, rhs) |
| 3 | lhs + rhs |
| 4 | end |
| 5 | |
| 6 | def self.sub(lhs, rhs) |
| 7 | lhs - rhs |
| 8 | end |
| 9 | |
| 10 | def self.multi(lhs, rhs) |
| 11 | lhs * rhs |
| 12 | end |
| 13 | |
| 14 | def self.div(lhs, rhs) |
| 15 | lhs / rhs |
| 16 | end |
| 17 | end |
Note: See TracBrowser for help on using the browser.