Mega Code Archive
Categories
/
Ruby
/
Method
You can pass data to code clocks used with methods simply by passing that data to the yield statement
def greeting() yield "Hello", "there!" end greeting {|word_one, word_two | puts word_one + " " + word_two}