class PactBroker::Api::Renderers::IntegrationsDotRenderer
Attributes
Public Class Methods
Source
# File lib/pact_broker/api/renderers/integrations_dot_renderer.rb, line 9 def self.call(integrations) new(integrations).call end
Source
# File lib/pact_broker/api/renderers/integrations_dot_renderer.rb, line 5 def initialize(integrations) @integrations = integrations end
Public Instance Methods
Source
# File lib/pact_broker/api/renderers/integrations_dot_renderer.rb, line 13 def call "digraph { ranksep=3; ratio=auto; overlap=false; node [ shape = plaintext, fontname = Helvetica ]; #{integrations_graph} } " end
Private Instance Methods
Source
# File lib/pact_broker/api/renderers/integrations_dot_renderer.rb, line 30 def escape_name(name) name.tr(" ", "_") end
Source
# File lib/pact_broker/api/renderers/integrations_dot_renderer.rb, line 24 def integrations_graph integrations .collect{ | integration| " #{escape_name(integration.consumer_name)} -> #{escape_name(integration.provider_name)}" } .join("\n") end