I've created the following class
class BankAccount
def accountNumber
@accountNumber=5
end
def accountNumber=(value)
@accountNumber=value
end
end
and I use it like this:
account=BankAccount.new
=> #<BankAccount:0x0000000295d6c8>
account.accountNumber
=> 5
account.accountNumber="223"
=> 223
account.accountNumber
=> 5
why is accountNumber
equal to 5
even after setting it to 223
?