June 2017
Beginner
330 pages
7h 30m
English
Let's begin by creating a simple proc:
full_name = Proc.new{ |first, last| first + " " + last}
Now, I can call this in two ways:
p full_name["Jordan", "Hudgens"]
p full_name.call("Jordan", "Hudgens")

Let's go back and retrace the proc process. In this code, I'm creating a new instance of Proc and assigning it to a variable called full_name. Procs can take a code block as their parameter, so we are passing two different arguments to ...
Read now
Unlock full access