Class: PDoc::Serializer
- Inherits:
-
Object
- Object
- PDoc::Serializer
- Defined in:
- lib/pdoc/runner.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
Returns the value of attribute path.
Instance Method Summary collapse
- #<<(fragment) ⇒ Object
-
#initialize ⇒ Serializer
constructor
A new instance of Serializer.
- #to_s ⇒ Object
Constructor Details
#initialize ⇒ Serializer
Returns a new instance of Serializer.
96 97 98 |
# File 'lib/pdoc/runner.rb', line 96 def initialize @doc_fragments = [] end |
Instance Attribute Details
#path ⇒ Object
Returns the value of attribute path.
95 96 97 |
# File 'lib/pdoc/runner.rb', line 95 def path @path end |
Instance Method Details
#<<(fragment) ⇒ Object
100 101 102 103 104 |
# File 'lib/pdoc/runner.rb', line 100 def <<(fragment) fragment = "---\n#{fragment}" fragment << "\nfile: #{path}" @doc_fragments << fragment end |
#to_s ⇒ Object
106 107 108 |
# File 'lib/pdoc/runner.rb', line 106 def to_s @doc_fragments.join("\n\n") end |