In Files

  • prettyprint.rb

Parent

PrettyPrint::SingleLine

Public Class Methods

new(output, maxwidth=nil, newline=nil) click to toggle source
 
               # File prettyprint.rb, line 345
def initialize(output, maxwidth=nil, newline=nil)
  @output = output
  @first = [true]
end
            

Public Instance Methods

breakable(sep=' ', width=nil) click to toggle source
 
               # File prettyprint.rb, line 354
def breakable(sep=' ', width=nil)
  @output << sep
end
            
first?() click to toggle source
 
               # File prettyprint.rb, line 373
def first?
  result = @first[-1]
  @first[-1] = false
  result
end
            
flush() click to toggle source
 
               # File prettyprint.rb, line 370
def flush
end
            
group(indent=nil, open_obj='', close_obj='', open_width=nil, close_width=nil) click to toggle source
 
               # File prettyprint.rb, line 362
def group(indent=nil, open_obj='', close_obj='', open_width=nil, close_width=nil)
  @first.push true
  @output << open_obj
  yield
  @output << close_obj
  @first.pop
end
            
nest(indent) click to toggle source
 
               # File prettyprint.rb, line 358
def nest(indent)
  yield
end
            
text(obj, width=nil) click to toggle source
 
               # File prettyprint.rb, line 350
def text(obj, width=nil)
  @output << obj
end
            

Commenting is here to help enhance the documentation. For example, code samples, or clarification of the documentation.

If you have questions about Ruby or the documentation, please post to one of the Ruby mailing lists. You will get better, faster, help that way.

If you wish to post a correction of the docs, please do so, but also file bug report so that it can be corrected for the next release. Thank you.

If you want to help improve the Ruby documentation, please visit Documenting-ruby.org.

blog comments powered by Disqus