The Magic Pens of Ruby /ht @mattly
dablog.rubypal.com
13 Mar '12, 11pm
I’ve recently found myself describing single objects yielded by iterators as “magic pens.” Though it may sound more psycho...
It’s very easy. First we begin our placeholder with “%”, then we specify a zero (0) to signify padding with zeros. If we omitted this zero, the number would be padded with spaces instead. When we have done that, just specify the target length of the string. At last a single “d” is placed to signify that we are inserting a number.
Full article: http://apidock.com/ruby/String/insert#1266-Destructive-to...
I’ve recently found myself describing single objects yielded by iterators as “magic pens.” Though it may sound more psycho...