Join Kevin Skoglund for an in-depth discussion in this video Defining and calling methods, part of Ruby Essential Training.
In this chapter we're going to talk about Ruby's methods.…We are going to start out by talking about how we can define and call methods.…Now we've been working with methods already, as early as when we were talking…about the string class, we had Hello.…and we put the Reverse method on it, and that reversed all the characters.…And then we took the result to that, and we applied another method to it,…the Capitalize method.…And we did similar things, and we were looking at iterators and we were…looking at code blocks.…Now these methods are object methods.…They're meant to be applied to an object.…That's a little bit different than what we'll start out with, because we haven't…learned about object classes yet, and we'll get to that in the next chapter.…
This is going be basically standalone methods that we're talking about.…In a lot of other programming languages, they just call it Functions, but in…Ruby we call them methods.…The way you create a method is very simple, we have def, which is short for…
- 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.