Lesson 15


#1


https://www.codecademy.com/en/courses/ruby-beginner-en-zfe3o/3/1?curriculum_id=5059f8619189a5000201fbcb


I don't understand why "all systems go!" is not printed on the console after I call:

Application.print_status

the error message is:
undefined method `print_status' for Context::Application:Class


class Application
    
  attr_accessor :status
  def initialize; end
  public
    def print_status
        puts "All systems go!"
    end
        Application.print_status
end

thx for the help


#2

Can your method be called without an instance of your class?

It's also a little odd to call a method before having finished creating the class.


#3

hey Jonatan, thx for your fast reply....
I think I solved it with the following code:

class Application

attr_accessor :status
def initialize; end
# Add your method here!
public
def print_status
puts "All systems go!"
end
end
total = Application.new
total.print_status


#4

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