PrettyPrint::SingleLine (Class)

In: prettyprint.rb
Parent: Object

Methods

breakable   first?   flush   group   nest   new   text  

Public Class methods

[Source]

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

Public Instance methods

[Source]

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

[Source]

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

[Source]

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

[Source]

# File prettyprint.rb, line 377
    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 385
    def flush
    end

[Source]

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

[Validate]