Objects, Classes, and Instances
Instance
An Instance or Object is a concrete representation of a Class
Object
An Instance or Object is a concrete representation of a Class Each instance (object) contains instance variables which are the state of the object (attributes). Object behaviors are represented by methods.
Behavior
Behavior is what something does.
Class
In programming, a Class is something that models: State Behavior A thing can be a car, a book, and so on. Such things become classes (the blueprints of objects), and we create objects out of these classes.
State
State is what something is
Attributes
We can model attributes in code by using instance variables. Generally we define these instance variables in a special method called initialize that is run every time a new instance of a class is created.
self
self is ruby's way to identify the current object