
- Ruby
- Intermediate
About this Course
Modules are an extremely powerful utility when coding in Ruby. Modules allow you to add behavior to classes, hold constants, add namespaces, and more.
What you'll learn
- Modules
- Methods
- Class Methods
- Include and Extend
- Magic Methods in Ruby
Ruby Module Basics
In this stage, is to introduce the basics of working with modules in Ruby as well as give the students brief exposure to more advanced topics with modules.
6 stepsRuby Core Modules
In this stage, we'll learn about some of the modules that are included as part of the Ruby core distribution.
6 stepsInclude and Extend
Ruby Modules give you two different ways to augment behavior: Include and Extend. In this stage, we'll learn about the differences between the two as well as how to use them when creating our own modules.
6 stepsStore Inventory Using Modules
Now that we now how modules work, we’re going to write a simple program that simulates keeping inventory at a small retail store. The store sells shirts, pants, and accessories. We’re going to put everything together using modules, include, extend, and friends. Make sure to follow along using Workspaces.
10 stepsTeacher
-
Jason Seifer
Jason helped launch Treehouse and spent 4 years teaching here before returning to Rails development full time.