Skip to content

Instantly share code, notes, and snippets.

@irridescentrambler
Last active September 3, 2019 09:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save irridescentrambler/75de392b536d1eb95cd4742f3736240b to your computer and use it in GitHub Desktop.
Save irridescentrambler/75de392b536d1eb95cd4742f3736240b to your computer and use it in GitHub Desktop.
class A
end
class B < A
end
class C < B
end
A.descendants
# [B,C]
A.method(:descendants).source_location
# ["/Users/nikhilmohadikar/.rvm/gems/ruby-2.5.5@coupa_development/gems/activesupport-5.0.7.2/lib/active_support/core_ext/class/subclasses.rb", 9]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment