Class: MatchData
Overview
:nodoc:
Instance Method Summary collapse
-
#pretty_print(q) ⇒ Object
:nodoc:.
Instance Method Details
#pretty_print(q) ⇒ Object
:nodoc:
553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 |
# File 'lib/pp.rb', line 553 def pretty_print(q) # :nodoc: nc = [] self.regexp.named_captures.each {|name, indexes| indexes.each {|i| nc[i] = name } } q.object_group(self) { q.breakable q.seplist(0...self.size, lambda { q.breakable }) {|i| if i == 0 q.pp self[i] else if nc[i] q.text nc[i] else q.pp i end q.text ':' q.pp self[i] end } } end |