fork download
  1. def method(a, b, *args, &block)
  2. array = a,b
  3. if block_given?
  4. args.each {|v| block.call(v)}
  5. else
  6. puts "ERROR"
  7. end
  8. end
  9.  
  10. method(1, 2, 3, 4, 5, 6, 7) { |i| puts i }
Success #stdin #stdout 0.01s 5888KB
stdin
Standard input is empty
stdout
3
4
5
6
7