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

Methods

breakable   first?   flush   group   nest   new   text  

Public Class methods

[Source]

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

Public Instance methods

[Source]

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

[Source]

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

[Source]

# File prettyprint.rb, line 388
    def flush
    end

[Source]

# File prettyprint.rb, line 380
    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 376
    def nest(indent)
      yield
    end

[Source]

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

[Validate]