Learn

Let’s go ahead and create our private methods. (It makes sense to create these first, since our public methods will rely on them.)

Instructions

1.

Add two private methods to your Account class, pin and pin_error.pin should take no arguments and set an instance variable, @pin, equal to the PIN number 1234.

pin_error should take no arguments and should simply return the string "Access denied: incorrect PIN."

Take this course for free

By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.
Already have an account?