Fixnum and Bignum are deprecated in 2.4 • Writing a gem that might have to deal with both? – Check 1.class – Pre-2.4, you will get Fixnum – 2.4, you will get Integer
want to remove newline characters from your input? # In 2.3, you did this foo = gets.chomp # 2.4 foo = gets(chomp: true) Works for #gets, #readline, #each_line, #readlines and IO.foreach.
+ 'Crozier' => "SteveCrozier” ['Steve', 'Crozier'].sum => TypeError: String can't be coerced into Integer …but you must provide a starting value, if not an Integer ['Steve', 'Crozier'].sum('') => "SteveCrozier"
the $~ global variable. Since it doesn’t create a MatchData object or update $~, it performs better than #match. /Steve/.match(‘Steve’) # => slower /Steve/.match?(‘Steve’) # => faster