Class: Struct

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

Instance Method Summary collapse

Instance Method Details

#report_print(rp) ⇒ Object



109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# File 'lib/report_print/core_extensions.rb', line 109

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