gotcha: ruby += operator

Looks like there’s no += operators. My guess is compiler is probably converting a += b expressions into a = a + b, or more verbosely a.send(:=, a.send(:+, b)).

Here’s some quick experimentation:

irb> 0.send("+=", 1)
# => NoMethodError: undefined method `+=' for 0:Fixnum
irb> 0 += 1
# => SyntaxError: (irb):1: syntax error, unexpected tOP_ASGN, expecting $end
 
1
Kudos
 
1
Kudos

Now read this

The Sidekiq of 8 processes on Heroku Performance Dyno

So…I had the honor of doing some data migration, which happens to be CPU, and memory intensive. I called upon Heroku PX Dyno and the Sidekiq with the wrath of one process and 100 threads. # loading PX with one process and 100 threads $... Continue →