Ways to express proc inside a method
To answer your question directly, you can express a proc/block/lambda as

Proc.new do |...|
# or
lambda do |...|
# or
-&gt; (...) do


Either syntax (and your current one) should work fine for this. To invoke the block, you can use square brackets like now, or use call.

Really, that's about it, unless I'm misinterpreting your question.

However, I see some other issues with your code:


Use a hash for the arguments. Please. The current construction is very un-Ruby-like. A hash will also "force" you to write the method (or block, in this case) in a more generic manner, since a hash can have any number of key/value pairs.
Why length? It's just a number. Whose to say it's the length of anything?
Also, why add 1 to length? Just wondering. If anything, going from an array's length to an index usually involves subtracting 1.


Something like this seems cleaner (though it's as much about FizzBuzz as it is about procs):

def custom_fizz_buzz(divisors = {"Fizz" =&gt; 3, "Buzz" =&gt; 5})
  divisors = divisors.sort_by { |_, value| value }
  -&gt; (number) do
    output = divisors.map { |key, value| key if (number % value).zero? }.compact.join
    output.empty? ? number : output
  end
end


which'll give you

custom_fizz_buzz[7]                              # =&gt; 7
custom_fizz_buzz.call(9)                         # =&gt; "Fizz"
custom_fizz_buzz[15]                             # =&gt; "FizzBuzz"
custom_fizz_buzz("What's " =&gt; 3, "up?" =&gt; 7)[21] # =&gt; "What's up?"


or even

1.upto(100).map(&amp;custom_fizz_buzz) # =&gt; [1, 2, "Fizz", 4, "Buzz", .... etc.]