Concerning Rails concerns
In Ruby, we have classes and modules. Classes allow us to build object hierarchies via inheritance. Modules, technically, are just sets of methods (or mixins) that can be attached to classes or used independently. Semantically though, modules usually fall into one of the following categories:
- Behavior: This includes behavior modules that add new features or serve a particular purpose for the class. Examples of behavior modules include Enumerable and Comparable.
- Builder: These are modules extending Ruby class declaration capabilities via DSL – for example, Forwardable.
- Static methods collection: These are modules acting as containers for static methods.
- Namespace: These are modules that are used solely to isolate constants (classes, other modules).
This book will only talk about behavior modules (the first group), since they can be considered architectural elements.
Ruby on Rails, being an opinionated framework, treats modules...