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.
- #to_s ⇒ Object
Constructor Details
#initialize(gem) ⇒ Tree
8 9 10 11 |
# File 'lib/lapidarius/tree.rb', line 8 def initialize(gem) @gem = gem @out = [] end |
Instance Method Details
#to_s ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/lapidarius/tree.rb', line 13 def to_s return @out unless @out.empty? @out.tap do |out| out << @gem recurse out << "" out << "#{@gem.count} runtime, #{@gem.dev_count} development" end end |