Join Kevin Skoglund for an in-depth discussion in this video Ranges, part of Ruby Essential Training.
- View Offline
- Exercise Files
In this movie we are going to talk about the Ruby object type for ranges.…Now a range is going to typically be a range of numbers.…Right, so let's say numbers from 1-10.…Well, we could have an array that would contain all of those numbers or we…could simply have a range which will say well, here is the starting point and…here is the end point. It's from 1-10.…Specially if we have something like 1- 1000, it makes a lot more sense to have…something that just tells us the start and end point instead of trying to…construct an array or something that has all 1000 numbers in it.…We can use a range instead.…And there is two kinds of ranges.…
There is the inclusive range, and the exclusive range.…And the notation is right there.…That's how it works.…It's just the first number and then either 2 or 3 dots depending on which…one you want to use.…Inclusive would be the numbers 1, 2, 3, 4, 5, 6, 7, 8, 9, 10.…Exclusive range would be 1, 2, 3, 4, 5, 6, 7, 8, 9.…It would exclude the last value.…So it would be one up to but not including 10.…
- Using Ruby in the Interactive Ruby Shell and in standalone scripts
- Learning to write custom code blocks to find, merge, and sort
- Using modules for namespacing or as mix-ins
- Reading from and writing to files
- Creating a full Ruby project from start to finish
Skill Level Beginner
1. Getting Started with Ruby
2. Ruby Object Types
3. Control Structures
4. Code Blocks
8. Working with Files
9. Ruby Project: Creating the Food Finder
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.