Class: Lapidarius::Tree
- Inherits:
-
Object
- Object
- Lapidarius::Tree
- Defined in:
- lib/lapidarius/tree.rb
Constant Summary collapse
- CURVED =
"└── "- EMPTY =
" "- NESTED =
"├── "- STRAIGHT =
"│ "
Instance Method Summary collapse
-
#initialize(gem) ⇒ Tree
constructor
A new instance of Tree.
- #out ⇒ Object
Constructor Details
#initialize(gem) ⇒ Tree
Returns a new instance of Tree.
10 11 12 13 |
# File 'lib/lapidarius/tree.rb', line 10 def initialize(gem) @gem = gem @out = [] end |
Instance Method Details
#out ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/lapidarius/tree.rb', line 15 def out return @out unless @out.empty? @out.tap do |out| out << @gem recurse out << "" out << "#{@gem.count} runtime dependencies" end end |