Class: Pact::Doc::Markdown::IndexRenderer

Inherits:
Object
  • Object
show all
Defined in:
lib/pact/doc/markdown/index_renderer.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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_nameObject (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

#docsObject (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

#callObject



17
18
19
# File 'lib/pact/doc/markdown/index_renderer.rb', line 17

def call
  title + "\n\n" + table_of_contents + "\n"
end