It's a little thing.
[Settings you want to make to copy the code to pry # Method 1: Make it a single expression ](Settings you want to make to copy the code to pry)
Line breaks will be ignored if enclosed in parentheses. It is ignored or considered in the middle of the expression until it closes.
A common pattern is when you want to define a function only while Console is up. I do this when I want to lightly test some of the methods.
In the Console
[1] pry(main)> (
[1] pry(main)* def hoge
[1] pry(main)* return 'hoge' #Processing content
[1] pry(main)* end
[1] pry(main)* )
=> :hoge
[2] pry(main)> hoge #call
=> "hoge"
It's like that.
Recommended Posts