Maintenance of Ruby 2.0.0 ended on February 24, 2016. Read more

In Files

  • prettyprint.rb

Parent

Methods

PrettyPrint::Text

Attributes

width[R]

Public Class Methods

new() click to toggle source
 
               # File prettyprint.rb, line 260
def initialize
  @objs = []
  @width = 0
end
            

Public Instance Methods

add(obj, width) click to toggle source
 
               # File prettyprint.rb, line 271
def add(obj, width)
  @objs << obj
  @width += width
end
            
output(out, output_width) click to toggle source
 
               # File prettyprint.rb, line 266
def output(out, output_width)
  @objs.each {|obj| out << obj}
  output_width + @width
end