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
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!
Comments
Post a Comment