Join Kevin Skoglund for an in-depth discussion in this video Conditionals: if, else, elsif, part of Ruby Essential Training.
- View Offline
- Exercise Files
In this chapter, we are going to be talking about the control structures inside Ruby.…In the previous chapter, we were talking about a lot of the basic object types, …but we really don't get that far if we are just assigning different…objects to variables.…Control structures are really going to provide the action that happens inside…of our Ruby programs.…It's what's going to decide what takes place under certain circumstances…and the first way that we are going to determine those circumstances is…using conditionals.…So this is, if something is true, we are going to do one thing.…If it's not true, do something else.…
Right, that's the basic thing.…We will run one set of code under one condition, another under…different conditions.…That's why they are called conditionals.…To do that, we are going to use the syntax of conditionals, which is going to be…if and then a boolean expression and then end at the end and then in between…will be the code that we want to take place if that Boolean value evaluates to true.…
- 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?
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.