Class: Fibonacci
Overview
The Fibonacci numbers: 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, etc.
Constant Summary
Constants included
from TeguGears
TeguGears::REPOSITORY_CLASS
Instance Method Summary
collapse
Methods included from TeguGears
included
Instance Method Details
#process(n) ⇒ Object
4
5
6
|
# File 'lib/examples/fibonacci.rb', line 4
def process(n)
n <= 2 ? 1 : Fibonacci.call(n-1) + Fibonacci.call(n-2)
end
|