Object-oriented programming (OOP) is a type of programming based on the concept of "objects", which can contain data, in the form of fields (often known as attributes or properties), and code, in the form of procedures (often known as methods). OOP is all about being able to structure code so that its functionality can be shared throughout the application. This is opposed to procedural programming (PP), in which you build programs in sequential order and call methods when you want shared behavior between pages in the application.
We'll be discussing these basics of OOP in Ruby:
- Classes and instances
- The
new
class method - Instance methods
- Local variables and instance variables
- Object Attributes
- Setter and Getter Methods
- Setting instance variables from initialize
Ruby is a powerful object-oriented language used by popular applications. In the upcoming lessons you'll build the foundational knowledge of OOP to be well on your way to developing your own!