Skip to Content
Methods, Blocks, & Sorting
Basic Methods

Let’s quickly review how to create a basic Ruby method.

def double(n) return n * 2 end

The example above is just a syntax reminder.



Create a method, welcome, that puts “Welcome to Ruby!” After defining your method, call it.

Folder Icon

Take this course for free

Already have an account?