Posts [ 5 ]

Topic: Equivalent to .= (dot equals) in Ruby?

I'm having a hard time wrapping my mind around these iterators in Ruby. I'm sure there is a simple slick way to do this, but I can't seem to track down the Ruby equivalent of the .= (dot equal) from PHP

I am simply trying to build a variable that is a string listing all of the items and their corresponding quantities in my shopping cart. The end result would be something like "Notebook x 3, Pencil x 2, Paper x 10"