On Mon, Oct 8, 2012 at 11:22 PM, Joz Private <lists / ruby-forum.com> wrote:

> def moves_loans
>      amount_of_loans = amount_of_loans - amount
> end

Here amount_of_loans is understoos as a local variable, since you have
an assigment, so the amount_of_loans at the right hand side gets
evaluated to nil. I guess you want the instance variable, so:

def moves_loans
  @amount_of_loans = @amount_of_loans - amount
end

or

def moves_loans
  @amount_of_loans -= amount
end

Jesus.