/ruby-syntax

Practice Ruby syntax

Primary LanguageRuby

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/