Cat, mouse, inception…

Modules in Ruby: Part II

Mehdi Farsi
Dec 5, 2018 · 3 min read

Introduction

Module.new

Anonymous modules

Module and Class

irb> Class.superclass
=> Module
irb> Module.class
=> Class

Definition of a class in Ruby

A class is an instance of the Class class stored in a constant.

The Class class is a specialisation of the Module class whose instances can be instantiated.

Definition of a module in Ruby

A module is an instance of the Module class stored in a constant.

The Module class is an instance of the Class class stored in a constant and whose instances cannot be instantiated.

inception..

May I have your attention please 🎤🎤

Feel free to subscribe here: www.rubycademy.com


rubycademy

E-Learning platform for Ruby and Ruby on Rails

Mehdi Farsi

Written by

Founder of www.rubycademy.com — I blog about Ruby & ROR - Paris

rubycademy

E-Learning platform for Ruby and Ruby on Rails