Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/onyxblade/pretty_ancestors
better ancestor info for ruby classes
https://github.com/onyxblade/pretty_ancestors
Last synced: 16 days ago
JSON representation
better ancestor info for ruby classes
- Host: GitHub
- URL: https://github.com/onyxblade/pretty_ancestors
- Owner: onyxblade
- Created: 2017-04-28T03:21:57.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-04-28T03:31:32.000Z (over 7 years ago)
- Last Synced: 2025-01-02T23:12:42.033Z (24 days ago)
- Language: Ruby
- Size: 4.88 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# pretty_ancestors
better ancestor info for ruby classes
## Usage
```ruby
module M1
endmodule M2
include M1
endmodule M3
endmodule M4
prepend M3
endmodule M5
endclass C
include M4
include M2
prepend M5
endpp C.pretty_ancestors
# =>
# [[[M5], C, [[M2, [M1]], [[M3], M4]]],
# [Object,
# [PP::ObjectMixin, Kernel]],
# BasicObject]pp C.pretty_ancestors(:raw)
# =>
# [[[[[], M5, []]], C, [[[], M2, [[[], M1, []]]], [[[[], M3, []]], M4, []]]],
# [[], Object, [[[], PP::ObjectMixin, []], [[], Kernel, []]]],
# [[], BasicObject, []]]# C.pretty_ancestors.flatten will always be equal to C.ancestors
```