Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialMatthew Main
7,566 PointsWhat are the syntax rules following "require" in Ruby?
Earlier in this lesson, "time" is required in irb using the syntax:
require 'time'
Here, "enumerable" is required inside a class using the syntax:
require Enumerable
When do you need to require using the lower-case/single-quote syntax, and when do you need to use the title-case syntax?
1 Answer
Daniel Cunningham
21,109 PointsIn most cases, when you a requiring something into your ruby files, you'll be using single quotes. Enumerable is a module in Ruby Core, while Date is actually a class. Because Enumerable is a module and part of Ruby Core, it's gets some 'special treatment' when being required in the syntax. A lot of Gems that you will end up pulling will be 'required' using single quotes. <br>