17.1 a little explaination about this code


#1
class Machine
  @@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} was created by #{@username} at #{time}."
  end
    def Machine.get_users
     @@users
  end
end

i want to ask about @files hash here
you notice that @@users is in the class body while @files is in the method body
+ why @@users been put in the class body unlike @files though they do the same job?!
+ is this different positioning just a matter of preference?
+ is @@users & @files here intended to do different jobs?

p.s i know about class variables,instance variables & such


#2

@a7lamlover,
Maybe reading this article
http://stackoverflow.com/questions/3802540/difference-between-class-variables-and-class-instance-variables
will give you a better feel...