Class: Struct
Instance Method Summary collapse
Instance Method Details
#report_print(rp) ⇒ Object
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
# File 'lib/report_print/core_extensions.rb', line 112 def report_print(rp) name = self.class.short_class_name rp.inline(" ") do rp.inline("") do rp.write(name, color: :bright_yellow) rp.write("(") end rp.write_object_id(self) 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 |