I'm new to programming and am trying to figure out the purpose of "initialize" in creating a class.

Here's an example:

```
class Person
  def initialize(name)
    @name = name
    @pet = nil
    @home = 'NYC'
  end
end

```

So initializing is to create a bunch of attributes that I can pull out directly by saying `Person.name` and `Person.pet` and `Person.home` right? Is "initialize" just to compact a bunch of variables into one place? Would I accomplish the same thing doing this:

```
class Person     
  pet = nil    
  home = 'NYC'    
  #not so sure how to replicate the @name here.    
end

```

Wouldn't I be able to access the values with `Person.pet` and `Person.home` the same way as I would in the first code?