Method: PrettyPrint::GroupQueue#deq

Defined in:
lib/prettyprint.rb

#deqObject

Returns the outer group of the queue



461
462
463
464
465
466
467
468
469
470
471
472
473
474
# File 'lib/prettyprint.rb', line 461

def deq
  @queue.each {|gs|
    (gs.length-1).downto(0) {|i|
      unless gs[i].breakables.empty?
        group = gs.slice!(i, 1).first
        group.break
        return group
      end
    }
    gs.each {|group| group.break}
    gs.clear
  }
  return nil
end