diff --git a/blocks_in_methods.rb b/blocks_in_methods.rb new file mode 100644 index 0000000..1f5b275 --- /dev/null +++ b/blocks_in_methods.rb @@ -0,0 +1,10 @@ +# blocks_in_methods.rb + +def some_method *args, &block + p args + block.call +end + +some_method 1, 3, 5, 7 do + puts "boom thata" +end diff --git a/debug.rb b/debug.rb new file mode 100644 index 0000000..d694c3e --- /dev/null +++ b/debug.rb @@ -0,0 +1,9 @@ +require 'debugger' + +def sum a, b + debugger # place this line where breakpoint is needed + c = a + b +end + +puts "Sum of 3 and 5 is #{sum 3,5}" +