Class: PDoc::Serializer

Inherits:
Object
  • Object
show all
Defined in:
lib/pdoc/runner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSerializer

Returns a new instance of Serializer.



96
97
98
# File 'lib/pdoc/runner.rb', line 96

def initialize
  @doc_fragments = []
end

Instance Attribute Details

#pathObject

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_sObject



106
107
108
# File 'lib/pdoc/runner.rb', line 106

def to_s
  @doc_fragments.join("\n\n")
end