Class: Data

Inherits:
Object show all
Defined in:
lib/report_print/core_extensions.rb

Direct Known Subclasses

ReportPrint::Printer::State

Instance Method Summary collapse

Instance Method Details

#report_print(rp) ⇒ Object



91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# File 'lib/report_print/core_extensions.rb', line 91

def report_print(rp)
  name = self.class.short_class_name
  rp.inline("") do
    rp.write(name, color: :blue)
    rp.write("[")
  end
  rp.multiline(after: "]", separator: ",") do
    self.to_h.each do |name, value|
      rp.inline(": ") do
        rp.write(name, color: :bright_cyan)
        rp.rp(value)
      end
    end
  end
end