Posts

Showing posts from July, 2018

Ruby 2.5 Major Changes

1. rescue/else/ensure are allowed inside do/end blocks without begin/end 2. Print backtrace and error message in reverse order (experimental) 3. Kernel#yield_self           2.yield_self { |n| n * 10 } #=> 20           names = ['Alice', 'Bob']            names.join(', ').yield_self { |s| "(#{s})" }           #=> "(Alice, Bob)" 4. String#delete_prefix/delete_suffix 5. Array#prepend/append as aliases of unshift/push 6. Hash#transform_keys/transform_keys!