#16 Private Affairs. >.<


#1



I've tried multiple tries on this code and no matter what it says: "Oops, Your Code doesn't look quite right! Check the Hint if you need help."

class Application

attr_accessor :status
def initialize; end
public
def print_status
puts "All systems go!"
Application.print_status
end
end
private
def password
return 12345
end
end


Replace this line with your code.


#2
    class Application
      attr_accessor :status
      def initialize
      end
      def print_status
        puts "All systems go!"
      end
      private
      def password
        "12345"
      end
    end
  • You probably want to call Application's print_status method outside class definition,
  • Methods return last evaluated value, no need for return in password method,
  • @status is never really set in initialize method which is empty

#3

Just tried it, but now it says: "Oops, try again. Does your Password Method return 12345 ?


#4

Maybe it insists on having the keyword return in this exercise. Try it out.


#5

Just did, still the same error... >.<

class Application
attr_accessor :status
def initialize
end
def print_status
puts "All systems go!"
end
private
def password
return "12345"
end
end


#6

This line does not belong here. The rest of the code looks correct.


#7

Sorry, I'm having the worst time understanding. T.T


#8

Try removing the quotes from your password, and write it as a number,

12345

Remember to include the public keyword above your print_status method.


#10

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.