Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add Class#hierarchy and Class#lineage #61

Merged
merged 1 commit into from
Jul 27, 2018

Conversation

Fryguy
Copy link
Member

@Fryguy Fryguy commented Jul 26, 2018

@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]

@Fryguy Fryguy force-pushed the class_hierarchy branch 3 times, most recently from 6a118ff to 73f5741 Compare July 26, 2018 21:48
@miq-bot
Copy link
Member

miq-bot commented Jul 26, 2018

Checked commit Fryguy@8f5358f 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. 🍰

@bdunne bdunne merged commit b2def1c into ManageIQ:master Jul 27, 2018
@Fryguy Fryguy deleted the class_hierarchy branch January 22, 2019 22:35
bdunne added a commit that referenced this pull request Feb 4, 2019
Added
- Added Enumerable#stable_sort_by [[#67](#67)]
- Added Math#slope_y_intercept, #slope_x_intercept, #linear_regression [[#50](#50)]
- Added Benchmark#realtime_store, #realtime_block and helper methods [[#65](#65)]
- Added Class#hierarchy and #lineage [[#61](#61)]
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants