I have this method which switches the number digit 5 with 7.

```
def switch_digit(num)
   if num <= 0
     return 0
   end

  digit = num % 10

  if (digit == 5) 
    digit = 7
  end

  return switch_digit(num/10) * 10 + digit
end

switch_digit(5952)

```

Can someone explain why once the method hits the base case it doesn't return 0? 

How does this recursive method actually work? Does it append the returned digit with the next digit?