Class: Pact::Doc::Markdown::IndexRenderer
- Inherits:
-
Object
- Object
- Pact::Doc::Markdown::IndexRenderer
- Defined in:
- lib/pact/doc/markdown/index_renderer.rb
Instance Attribute Summary collapse
-
#consumer_name ⇒ Object
readonly
Returns the value of attribute consumer_name.
-
#docs ⇒ Object
readonly
Hash of pact title => file_name.
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(consumer_name, docs) ⇒ IndexRenderer
constructor
A new instance of IndexRenderer.
Constructor Details
#initialize(consumer_name, docs) ⇒ IndexRenderer
Returns a new instance of IndexRenderer.
8 9 10 11 |
# File 'lib/pact/doc/markdown/index_renderer.rb', line 8 def initialize consumer_name, docs @consumer_name = consumer_name @docs = docs end |
Instance Attribute Details
#consumer_name ⇒ Object (readonly)
Returns the value of attribute consumer_name.
5 6 7 |
# File 'lib/pact/doc/markdown/index_renderer.rb', line 5 def consumer_name @consumer_name end |
#docs ⇒ Object (readonly)
Hash of pact title => file_name
6 7 8 |
# File 'lib/pact/doc/markdown/index_renderer.rb', line 6 def docs @docs end |
Class Method Details
.call(consumer_name, docs) ⇒ Object
13 14 15 |
# File 'lib/pact/doc/markdown/index_renderer.rb', line 13 def self.call consumer_name, docs new(consumer_name, docs).call end |
Instance Method Details
#call ⇒ Object
17 18 19 |
# File 'lib/pact/doc/markdown/index_renderer.rb', line 17 def call title + "\n\n" + table_of_contents + "\n" end |