Ruby Programming Language

  1. Object-Oriented Programming (OOP) in Ruby
    1. Classes and Objects
      1. Defining a Class
        1. class Keyword
          1. Class Names
            1. Class Body
            2. Creating Instances (Objects)
              1. new Method
                1. Object Instantiation
                2. The initialize Method (Constructor)
                  1. Constructor Parameters
                    1. Instance Variable Initialization
                      1. Constructor Overloading
                      2. Instance Variables (@variable)
                        1. Variable Scope
                          1. Encapsulation
                          2. Instance Methods
                            1. Method Definition
                              1. Method Access
                                1. self Reference
                                2. Object Identity and Equality
                                  1. object_id
                                    1. equal? Method
                                      1. == Method
                                        1. eql? Method
                                          1. hash Method
                                        2. Encapsulation
                                          1. Public Methods
                                            1. Default Visibility
                                              1. Public Interface
                                              2. Private Methods
                                                1. private Keyword
                                                  1. Access Restrictions
                                                    1. Internal Implementation
                                                    2. Protected Methods
                                                      1. protected Keyword
                                                        1. Same Class Access
                                                        2. Attribute Accessors
                                                          1. attr_reader
                                                            1. attr_writer
                                                              1. attr_accessor
                                                                1. Custom Accessors
                                                                2. Access Control Keywords
                                                                  1. Visibility Modifiers
                                                                    1. Method Visibility Changes
                                                                  2. Inheritance
                                                                    1. Creating Subclasses
                                                                      1. < Syntax
                                                                        1. Parent Class Reference
                                                                        2. The super Keyword
                                                                          1. Calling Parent Methods
                                                                            1. Parameter Passing
                                                                              1. super vs super()
                                                                              2. Overriding Methods
                                                                                1. Method Redefinition
                                                                                  1. Polymorphism
                                                                                  2. The Object Hierarchy
                                                                                    1. BasicObject
                                                                                      1. Object
                                                                                        1. Module
                                                                                          1. Class
                                                                                            1. Inheritance Chain
                                                                                            2. Single Inheritance
                                                                                              1. One Parent Class
                                                                                                1. Multiple Inheritance Alternatives
                                                                                              2. Modules and Mixins
                                                                                                1. Defining a Module
                                                                                                  1. module Keyword
                                                                                                    1. Module Structure
                                                                                                    2. Using Modules for Namespacing
                                                                                                      1. Namespace Organization
                                                                                                        1. Constant Scoping
                                                                                                          1. Nested Modules
                                                                                                          2. Using Modules as Mixins
                                                                                                            1. include
                                                                                                              1. prepend
                                                                                                                1. extend
                                                                                                                  1. Method Lookup Chain
                                                                                                                  2. Differences between include, prepend, and extend
                                                                                                                    1. Instance vs Class Methods
                                                                                                                      1. Method Resolution Order
                                                                                                                        1. Use Cases
                                                                                                                        2. Constants in Modules
                                                                                                                          1. Module Constants
                                                                                                                            1. Constant Lookup
                                                                                                                            2. Module Callbacks
                                                                                                                              1. included Hook
                                                                                                                                1. extended Hook
                                                                                                                                  1. prepended Hook
                                                                                                                                2. Class Variables and Class Methods
                                                                                                                                  1. Class Variables (@@variable)
                                                                                                                                    1. Shared State
                                                                                                                                      1. Inheritance Behavior
                                                                                                                                        1. Thread Safety Concerns
                                                                                                                                        2. Defining Class Methods (self.method_name)
                                                                                                                                          1. Class Method Syntax
                                                                                                                                            1. Alternative Definitions
                                                                                                                                            2. Singleton Methods
                                                                                                                                              1. Object-Specific Methods
                                                                                                                                                1. Eigenclass
                                                                                                                                                2. Class Instance Variables
                                                                                                                                                  1. @variable in Class Context
                                                                                                                                                    1. vs Class Variables