Class: Data

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

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#pretty_print(q) ⇒ Object

:nodoc:



424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
# File 'lib/pp.rb', line 424

def pretty_print(q) # :nodoc:
  class_name = PP.mcall(self, Kernel, :class).name
  class_name = " #{class_name}" if class_name
  q.group(1, "#<data#{class_name}", '>') {
    q.seplist(PP.mcall(self, Kernel, :class).members, lambda { q.text "," }) {|member|
      q.breakable
      q.text member.to_s
      q.text '='
      q.group(1) {
        q.breakable ''
        q.pp public_send(member)
      }
    }
  }
end

#pretty_print_cycle(q) ⇒ Object

:nodoc:



440
441
442
# File 'lib/pp.rb', line 440

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