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.
11 12 13 14 |
# File 'lib/pact/doc/markdown/index_renderer.rb', line 11 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.
8 9 10 |
# File 'lib/pact/doc/markdown/index_renderer.rb', line 8 def consumer_name @consumer_name end |
#docs ⇒ Object (readonly)
Hash of pact title => file_name
9 10 11 |
# File 'lib/pact/doc/markdown/index_renderer.rb', line 9 def docs @docs end |
Class Method Details
.call(consumer_name, docs) ⇒ Object
16 17 18 |
# File 'lib/pact/doc/markdown/index_renderer.rb', line 16 def self.call consumer_name, docs new(consumer_name, docs).call end |
Instance Method Details
#call ⇒ Object
20 21 22 |
# File 'lib/pact/doc/markdown/index_renderer.rb', line 20 def call title + "\n\n" + table_of_contents + "\n" end |