In the code snippet you specified, the vertical lines are part of the block definition syntax. Thus, { |x| print x } { |x| print x } is a block of code provided as an argument to the upto method, 9 also a parameter passed to the upto method.
A block of code is represented by a lambda or a Proc class object in Ruby. lambda in this case is an anonymous function.
To simply draw an analogy with the function definition syntax,
def function_name(foo, bar, baz)
source share