Why won't it puts to console?!


#1



https://www.codecademy.com/en/courses/ruby-beginner-en-X5wcR/0/8?curriculum_id=5059f8619189a5000201fbcb

I'm completely at a loss as to why my code won't "puts" to my console. I have triple checked it against the initial exercise, and followed advice from the forums. As you can see I do call it at the end too. Can anyone please help me specifically identify what I'm doing wrong? It would be hugely appreciated!


class Computer
    @@users = {}
    def initialize(username, password) 
        @username = username
        @password = password
        @@users[username] = password
        @files = {}
    end
    
def create(filename)
    time = Time.now
    @files[filename] = time
    puts "#{filename} been created dude! Woo hoo! It also tells you that it was #{username} at specifically #{time}."
end

def Computer.get_users
    @@users
end
end

my_computer = Computer.new("rubyannem","steak1")
my_computer.create("magazine.txt")
puts "Users: #{Computer.get_users}"


#2

This should be a method call

Computer.get_users()

#3

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