Guest User

Untitled

a guest
Apr 24th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. # In the Ruby file, foo.rb
  2.  
  3. class Foo
  4. def fib(n)
  5. if (n < 2)
  6. n
  7. else
  8. fib(n - 2) + fib(n - 1)
  9. end
  10. end
  11. end
  12.  
  13.  
  14. # In the Duby file, foo.duby
  15.  
  16. class Foo
  17. method fib
  18. takes n => Integer::TYPE
  19. returns Integer::TYPE
  20. end
  21. end
Add Comment
Please, Sign In to add comment