Closed Fryguy closed 6 years ago
@bdunne Please review. See specs for examples.
I frequently need this in order to understand a given OO class hierarchy or lineage, so this is probably mostly for diagnostic usage, but useful nonetheless.
require 'socket' IO.hierarchy # => {BasicSocket=> # {Socket=>{}, # IPSocket=>{TCPSocket=>{TCPServer=>{}}, UDPSocket=>{}}, # UNIXSocket=>{UNIXServer=>{}}}, # File=>{}} TCPServer.lineage # => [TCPSocket, IPSocket, BasicSocket, IO, Object, BasicObject]
Checked commit https://github.com/Fryguy/more_core_extensions/commit/8f5358fea87df1e8ec9a056057255945347823aa with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 4 files checked, 0 offenses detected Everything looks fine. :cake:
@bdunne Please review. See specs for examples.
I frequently need this in order to understand a given OO class hierarchy or lineage, so this is probably mostly for diagnostic usage, but useful nonetheless.