Class: Struct

Inherits:
Object show all
Defined in:
lib/pp.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#pretty_print(q) ⇒ Object

:nodoc:



380
381
382
383
384
385
386
387
388
389
390
391
392
# File 'lib/pp.rb', line 380

def pretty_print(q) # :nodoc:
  q.group(1, sprintf("#<struct %s", PP.mcall(self, Kernel, :class).name), '>') {
    q.seplist(PP.mcall(self, Struct, :members), lambda { q.text "," }) {|member|
      q.breakable
      q.text member.to_s
      q.text '='
      q.group(1) {
        q.breakable ''
        q.pp self[member]
      }
    }
  }
end

#pretty_print_cycle(q) ⇒ Object

:nodoc:



394
395
396
# File 'lib/pp.rb', line 394

def pretty_print_cycle(q) # :nodoc:
  q.text sprintf("#<struct %s:...>", PP.mcall(self, Kernel, :class).name)
end