Description
In this course, you will learn :
- The fundamentals of object-oriented programming.
- Hhow to define classes, which serve as templates for creating object instances with distinct behaviours and attributes.
- How to use inheritance to share attributes and methods between superclasses and subclasses—and to extend or override them as needed.
- How to use modules as namespaces to avoid code conflicts or as mixins to share functionality between classes.
- provides you with step-by-step demonstrations, examples, and challenges to help you practise your new Ruby skills.
Syllabus :
1. Classes
- Define a class
- Instances
- Attributes
- Reader and writer methods
- Attribute methods
- Method access control
- Initialize method
2. Class Attributes and Methods
- Class methods
- Class attributes
- Class reader and writer methods
3. Inheritance
- Class inheritance
- Override and extend
- Access the superclass
4. Dates and Times
- Time
- Date
- DateTime
5. Modules
- Namespacing
- Mixins
- Load, require, and include
6. Exceptions
- Handle exceptions
- Handle specific exceptions
- Exception methods
- Raise exceptions
- Custom exceptions