Your Teacher
About This Episode
A method or function is a way to define a group of code that can be used repeatedly. We'll learn how to define methods in our Ruby code and then use them multiple times.
Notes
What's the difference between a method and function? A method and function are exactly the same thing in Ruby.
In other languages, a function refers to a group of code that performs a specific task and method would be a function that is associated with an object (class).
For Ruby, everything is an object so a function and method are the same thing.
Ruby for Beginners
0% Complete
1
Ruby Scripts & IRB
14m
2
Strings in Ruby
34m
3
Integers & Floats in Ruby
19m
4
Arrays in Ruby
33m
5
Hashes in Ruby
26m
6
Conditionals in Ruby
59m
Methods & Functions in Ruby
26m
8
Refactoring our Ruby code
41m
9
Loops & Blocks in Ruby
47m
10
Classes & Objects in Ruby
46m