You could also do this with recursion:
  def fac(num)
    return 1 if num.zero?
    1.upto(num).inject(:\*)
  end