class PrettyPrint
Public Class Methods
new(quote,length)
click to toggle source
# File lib/pretty-printing.rb, line 2 def initialize(quote,length) @quote = quote @length = length @arr = @quote.split(" ") end
Public Instance Methods
format()
click to toggle source
# File lib/pretty-printing.rb, line 8 def format q = [] i = 0 while i < @arr.length q << " | #{@arr[i..i+@length].join(" ")}" i += @length+1 end @quote = q.join("\n") end