What the ampersand in front of &block means

Let’s talk about blocks and Proc objects a little bit, starting with Proc objects.Here’s a method which takes an argument. The method doesn’t care of what type the argument is. All the method does is output the argument’s class.After we define the method, we call the method and pass it a Proc object. (If you’re not too familiar with Proc objects, you may want to check out my other post, Understanding Ruby Proc objects.).


What the ampersand in front of &block means #ruby #rubydeveloper #rubyonrails https://rubyonrails.ba/single/what-the-ampersand-in-front-of

Nezir Zahirovic

Contractor Ruby On Rails (8+ years) / MCPD .Net / C# / Asp.Net / CSS / SQL / (11 years)

related articles