lib/programming_ipsum/base.rb
def all_phrases
      width = @phrases.length.to_s.length

      # twice as fast as string concat!
      input = @phrases.each_with_index.map do |phrase, i|
        i.to_s.rjust(width) + ": " + phrase
      end.join("\n")

      render(input)
    end
# For debugging purposes only - not optimized for general use
For debugging purposes only - not optimized for general use
For debugging purposes only - not optimized for general use
def all_phrases
      width = @phrases.length.to_s.length
      input = @phrases.each_with_index.map do |phrase, i|
        i.to_s.rjust(width) + ": " + phrase
      end.join("\n")
      render(input)
    end
def all_phrases width = @phrases . length . to_s . length input = @phrases . each_with_index . map do | phrase , i | i . to_s . rjust ( width ) + ": " + phrase end . join ( "\n" ) render ( input ) end
For debugging purposes only - not optimized for general use
For debugging purposes only - not optimized for general use
# twice as fast as string concat!