https://github.com/nur-alam39/ruby-syntax
Practice Ruby syntax
https://github.com/nur-alam39/ruby-syntax
inheritance keyword mixins namespaces ruby ruby-syntax
Last synced: 10 months ago
JSON representation
Practice Ruby syntax
- Host: GitHub
- URL: https://github.com/nur-alam39/ruby-syntax
- Owner: Nur-Alam39
- Created: 2020-10-09T04:39:33.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2020-10-19T09:47:28.000Z (over 5 years ago)
- Last Synced: 2025-01-29T07:37:02.142Z (over 1 year ago)
- Topics: inheritance, keyword, mixins, namespaces, ruby, ruby-syntax
- Language: Ruby
- Homepage:
- Size: 36.1 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ruby-syntax
Practice Ruby syntax
# Resources:
## Book
1. The Well-Grounded Rubyist, 3rd Edition
2. Beginning Ruby
## Online Resources
1. https://www.rubyguides.com/
## Topics
- Data Types
- Array
- Hashes
- Class
- Object
- Symbols
- Range Operators
- String
- Control Flow
- Getter Setter
- Attribute Accessor
- Encapsulation
- Inheritance
## Module
A Module is a collection of methods, constants, and class variables. Modules are defined as a class, but with the module keyword not with class keyword.
## Important Points about Modules:
- You cannot inherit modules or you can’t create a subclass of a module.
- Objects cannot be created from a module.
- Modules are used as namespaces and as mixins.
- All the classes are modules, but all the modules are not classes.
- The class can use namespaces, but they cannot use mixins like modules.
- The name of a module must start with a capital letter.
## Blocks, Lambda & Procs
https://www.rubyguides.com/2016/02/ruby-procs-and-lambdas/