---
title: "Why you should nest modules in Ruby"
url: https://daily.dev/posts/why-you-should-nest-modules-in-ruby-jpzovoh94
source_url: https://thoughtbot.com/blog/why-you-should-nest-modules-in-ruby
type: article
source: "thoughbot"
published: 2024-05-16T00:04:50.004Z
updated: 2024-05-16T00:04:48.142Z
tags: ["ruby"]
reading_time: 3
upvotes: 1
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Why you should nest modules in Ruby

**[thoughbot](https://daily.dev/sources/thoughbot)** · 3 min read · 1 upvotes · 0 comments

## Summary

Learn about the functional differences between nested and inline modules in Ruby, including how referencing classes differs and why this behavior occurs. Discover the benefits of nesting modules and the potential issues with using inline modules.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://thoughtbot.com/blog/why-you-should-nest-modules-in-ruby>

## Similar posts on daily.dev

- [Don’t just attend KubeCon \+ CloudNativeCon, Merge Forward your experience\!](https://daily.dev/posts/don-t-just-attend-kubecon-cloudnativecon-merge-forward-your-experience--l0rpp73x8) · CNCF · 0 upvotes · 0 comments
- [Announcing H2 2026 KCDs](https://daily.dev/posts/announcing-h2-2026-kcds-m96goajm1) · CNCF · 1 upvotes · 0 comments
- [Two months of Open Community Groups](https://daily.dev/posts/two-months-of-open-community-groups-asf52zhbs) · CNCF · 0 upvotes · 0 comments

---

Tags: [#ruby](https://daily.dev/tags/ruby)

[View this post on daily.dev](https://daily.dev/posts/why-you-should-nest-modules-in-ruby-jpzovoh94)
