Sha256: e7efcf81865f758c811b8717354572cd5f222db6be09407e74004d4165d8e25d
Contents?: true
Size: 941 Bytes
Versions: 21
Compression:
Stored size: 941 Bytes
Contents
require 'pact/doc/interaction_view_model' module Pact module Doc module Markdown class InteractionRenderer attr_reader :interaction def initialize interaction, pact @interaction = InteractionViewModel.new(interaction, pact) end def render_summary suffix = interaction.has_provider_state? ? " given #{interaction.provider_state}" : "" "* [#{interaction.description(true)}](##{interaction.id})#{suffix}\n\n" end def render_full_interaction render('/interaction.erb') end def render template_file ERB.new(template_string(template_file)).result(binding) end def template_string(template_file) File.read( template_contents(template_file) ) end def template_contents(template_file) File.dirname(__FILE__) + template_file end end end end end
Version data entries
21 entries across 21 versions & 1 rubygems