Class PrettyPrint::SingleLine
In: prettyprint.rb
Parent: Object

Methods

breakable   first?   flush   group   nest   new   text  

Public Class methods

[Source]

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

Public Instance methods

[Source]

# File prettyprint.rb, line 354
    def breakable(sep=' ', width=nil)
      @output << sep
    end

[Source]

# File prettyprint.rb, line 373
    def first?
      result = @first[-1]
      @first[-1] = false
      result
    end

[Source]

# File prettyprint.rb, line 370
    def flush
    end

[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

[Source]

# File prettyprint.rb, line 358
    def nest(indent)
      yield
    end

[Source]

# File prettyprint.rb, line 350
    def text(obj, width=nil)
      @output << obj
    end

[Validate]

ruby-doc.org is a service of James Britt and Happy Camper Studios, a Ruby application development company in Phoenix, AZ.

Documentation content on ruby-doc.org is provided by remarkable members of the Ruby community.

For more information on the Ruby programming language, visit ruby-lang.org.

Want to help improve Ruby's API docs? See Ruby Documentation Guidelines.