Class: Struct

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

Direct Known Subclasses

PDF::Charts::StdDev::DataPoint

Instance Method Summary collapse

Instance Method Details

#pretty_print(q) ⇒ Object



739
740
741
742
743
744
745
746
747
748
749
750
751
# File 'lib/extensions/mspec/mspec/pp.rb', line 739

def pretty_print(q)
  q.group(1, '#<struct ' + 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



753
754
755
# File 'lib/extensions/mspec/mspec/pp.rb', line 753

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