I cannot figure out what is wrong with this code, help please?


#1

https://www.codecademy.com/courses/ruby-beginner-en-32cN3/0/3?curriculum_id=5059f8619189a5000201fbcb

Oops, try again. It looks like your pin_error method doesn't return "Access denied: incorrect PIN."

class Account
    attr_reader :name, :balance
    def initialize(name, balance=100)
     @name = name
     @balance = balance
    end

    private
    
    def pin
        @pin = 1234
    end
    def pin_error 
    "Acces denied: incorrect PIN."
    end
end

#2

Hi this line..

"Acces denied: incorrect PIN."

just add return before it ...then it's also missing one s to Access


#3

Hi wizmarco, I just tried with return and I get the same message back nil on the dislpay and the same "Oops, try again..."

the "return" code is this:
class Account
attr_reader :name, :balance
def initialize(name, balance=100)
@name = name
@balance = balance
end

private

def pin
    @pin = 1234
end
def pin_error 
return "Acces denied: incorrect PIN."
end

end

Thank you for your time


#4

this line

return "Acces denied: incorrect PIN."

you wrote Acces instead of Access


#5

Thank you so much for re-opening my eyes:) I really made a fool of myself, really tired, all new for me.