Closed rohieb closed 1 year ago
Apparently the '=' operator binds stronger than the 'or' operator:
$ irb irb(main):001:0> array = [] => [] irb(main):002:0> cmd_name = array.shift or "status" => "status" irb(main):003:0> cmd_name.inspect => "nil" irb(main):004:0> cmd_name = (array.shift or "status") => "status" irb(main):005:0> cmd_name.inspect => "\"status\""
Put a pair of braces around it to fix the order.
Oh interesting! That must've changed with some Ruby version! Thanks for the fix!
Apparently the '=' operator binds stronger than the 'or' operator:
Put a pair of braces around it to fix the order.