Check out example codes for "fibonacci sums ruby". It will help you in understanding the concepts better.

Code Example 1

# Write a method that finds the sum of the first n fibonacci numbers recursively. 
# Assume n > 0.

def fibs_sum(n)
  return 1 if n == 1
  return 2 if n == 2
  n + fibs_sum(n-1)
end

Learn ReactJs, React Native from akashmittal.com