Class: Treedent::NodeDrawing
- Inherits:
-
Struct
- Object
- Struct
- Treedent::NodeDrawing
- Defined in:
- lib/treedent/node_drawing.rb
Constant Summary collapse
- SPACE =
" "
- BAR =
"│ "
- TEE =
"├── "
- CORNER =
"└── "
Instance Attribute Summary collapse
-
#node ⇒ Object
Returns the value of attribute node.
Instance Method Summary collapse
Instance Attribute Details
#node ⇒ Object
Returns the value of attribute node
2 3 4 |
# File 'lib/treedent/node_drawing.rb', line 2 def node @node end |
Instance Method Details
#drawings ⇒ Object
12 13 14 15 |
# File 'lib/treedent/node_drawing.rb', line 12 def drawings return [] if node.orphan? [outer_indentation, inner_indentation].flatten end |
#to_s ⇒ Object
8 9 10 |
# File 'lib/treedent/node_drawing.rb', line 8 def to_s [drawings, node.value.content].compact.join end |