https://github.com/siman-man/object_tree
ObjectTree is like tree command for Ruby ancestors.
https://github.com/siman-man/object_tree
gem ruby
Last synced: 10 months ago
JSON representation
ObjectTree is like tree command for Ruby ancestors.
- Host: GitHub
- URL: https://github.com/siman-man/object_tree
- Owner: siman-man
- License: mit
- Created: 2013-09-19T03:54:29.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2017-09-27T21:50:12.000Z (over 8 years ago)
- Last Synced: 2024-11-30T14:17:33.920Z (over 1 year ago)
- Topics: gem, ruby
- Language: Ruby
- Homepage:
- Size: 47.9 KB
- Stars: 2
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# ObjectTree
[](https://travis-ci.org/siman-man/object_tree)
ObjectTree is like tree command for Ruby ancestors.
## Installation
```
$ gem install object_tree
```
## Usage
``` ruby
require 'object_tree'
class A
end
class B < A
end
class C < B
end
puts ObjectTree.create(A)
```
output
```zsh
A
└───── B
└───── C
```
more complex pattern
```ruby
require 'object_tree'
module D
end
module E
end
class A
include D
end
class B < A
end
class C < A
include E
end
class F < B
include E
end
puts ObjectTree.create(D)
```
output
```
D
└───── A
├───── B
│ └───── E
│ └───── F
└───── E
└───── C
```
can use from terminal by using `rotree` command.
```
$ rotree Numeric
```
Ruby 2.3.3
```
Numeric
├───── Complex
├───── Float
├───── Integer
│ ├───── Bignum
│ └───── Fixnum
└───── Rational
```
Ruby 2.4.0
```
Numeric
├───── Complex
├───── Float
├───── Integer
└───── Rational
```
you can see unify Fixnum and Bignum into Integer from ruby 2.4.0
## Contributing
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request