Object inspection helpers

When said the HELPFUL tools and crystal play, i remember this post by @asterite . (fine, he should have been away from the community for a long time, and it shouldn’t mind me @ him, anyway)

https://play.crystal-lang.org/#/r/dfjf

Those methods defined in that play HELP ME A LOT when use Crystal, e.g. one_object.methods print all methods defined on one_object’s class, one_object.all_methods print all methods defined on class and all super class and includeded module. OneClass.all_subclasses print all subclass. etc.

every time I meet a issue, I always require it and print some useful info to help me understand the code, we really should introduce this into the crystal tools, both Ruby and Elixir have those Equivalent in the language.

1 Like