class Pact::Doc::Markdown::IndexRenderer
Attributes
Public Class Methods
Source
# File lib/pact/doc/markdown/index_renderer.rb, line 13 def self.call consumer_name, docs new(consumer_name, docs).call end
Source
# File lib/pact/doc/markdown/index_renderer.rb, line 8 def initialize consumer_name, docs @consumer_name = consumer_name @docs = docs end
Public Instance Methods
Source
# File lib/pact/doc/markdown/index_renderer.rb, line 17 def call title + "\n\n" + table_of_contents + "\n" end
Private Instance Methods
Source
# File lib/pact/doc/markdown/index_renderer.rb, line 33 def item title, file_name "* [#{title}](#{file_name})" end
Source
# File lib/pact/doc/markdown/index_renderer.rb, line 23 def table_of_contents docs.collect do | title, file_name | item title, file_name end.join("\n") end
Source
# File lib/pact/doc/markdown/index_renderer.rb, line 29 def title "### Pacts for #{consumer_name}" end