Class: PartialFinder::Printer
- Inherits:
-
Object
- Object
- PartialFinder::Printer
- Defined in:
- lib/partial_finder/printer.rb
Overview
Printer class can accept and stringify any class that implements #structure such that #structure returns an array of Links.
Constant Summary collapse
- TAB =
" ".freeze
Instance Attribute Summary collapse
-
#string ⇒ Object
readonly
Returns the value of attribute string.
-
#structure ⇒ Object
readonly
Returns the value of attribute structure.
Instance Method Summary collapse
-
#initialize(graph) ⇒ Printer
constructor
Can be any class that has a #structure method.
Constructor Details
#initialize(graph) ⇒ Printer
Can be any class that has a #structure method
10 11 12 13 14 |
# File 'lib/partial_finder/printer.rb', line 10 def initialize(graph) @structure = graph.structure @string = "" structure.map{ |link| stringify_link(link) } end |
Instance Attribute Details
#string ⇒ Object (readonly)
Returns the value of attribute string.
5 6 7 |
# File 'lib/partial_finder/printer.rb', line 5 def string @string end |
#structure ⇒ Object (readonly)
Returns the value of attribute structure.
5 6 7 |
# File 'lib/partial_finder/printer.rb', line 5 def structure @structure end |