fork download
  1. #===================Yield================================#
  2.  
  3. ## inline block uses '{}' multiline block uses 'do' & 'end'
  4. def yeildTest()
  5. puts "This is puts"
  6. yield
  7. yield
  8. yield
  9. end
  10.  
  11. yeildTest { puts "this is yield" }
Success #stdin #stdout 0.02s 9768KB
stdin
Standard input is empty
stdout
This is puts
this is yield
this is yield
this is yield