Modules
- Modules are similar to Classes, but modules only can use methods and constants.
- Module uses extend and include to modify classes and objects.
- Hashes can use symbols instead of strings to identify keys ex(:one => 1)
- We can convert symbols to strings and vice versa buy using the methods .to_sym and .to_s.
- We must use and initialize method in a class. It boots up the objects that the class creates.
- Can create and instance of a class by calling new on the class name. An instance variable is attached to the instance of that class hence its name.
No comments:
Post a Comment