Sha256: 53756e3059cf6d436429ea88257cfbdedaa3a91a244ec288c5f5760385e3c3e0

Contents?: true

Size: 464 Bytes

Versions: 49

Compression:

Stored size: 464 Bytes

Contents

module Renderer
  class Json
    def initialize(file_name, config)
      @nodes = []
      @edges = []
      @file_name = file_name
      @config = config
    end

    def add_node(name)
      @nodes << {id: name, label: name}
    end

    def add_edge(from, to, opts)
      @edges << {id: "#{from}-#{to}", source: from, target: to, label: opts[:label]}
    end

    def output
      IO.write(@file_name, {nodes: @nodes, edges: @edges}.to_json)
    end

  end
end

Version data entries

49 entries across 49 versions & 1 rubygems

Version Path
aws_security_viz-0.1.7.pre.alpha.pre.145 lib/renderer/json.rb
aws_security_viz-0.1.7.pre.alpha.pre.138 lib/renderer/json.rb
aws_security_viz-0.1.7.pre.alpha.pre.136 lib/renderer/json.rb
aws_security_viz-0.1.6.pre.alpha.pre.134 lib/renderer/json.rb
aws_security_viz-0.1.6 lib/renderer/json.rb
aws_security_viz-0.1.5.pre.alpha.pre.133 lib/renderer/json.rb
aws_security_viz-0.1.5.pre.alpha.pre.131 lib/renderer/json.rb
aws_security_viz-0.1.5.pre.alpha.pre.130 lib/renderer/json.rb
aws_security_viz-0.1.5.pre.alpha.pre.112 lib/renderer/json.rb
aws_security_viz-0.1.5.pre.alpha.pre.111 lib/renderer/json.rb
aws_security_viz-0.1.5.pre.alpha.pre.110 lib/renderer/json.rb
aws_security_viz-0.1.5.pre.alpha.pre.109 lib/renderer/json.rb
aws_security_viz-0.1.5.pre.alpha.pre.108 lib/renderer/json.rb
aws_security_viz-0.1.5.pre.alpha.pre.107 lib/renderer/json.rb
aws_security_viz-0.1.5.pre.alpha.pre.106 lib/renderer/json.rb
aws_security_viz-0.1.5.pre.alpha.pre.103 lib/renderer/json.rb
aws_security_viz-0.1.5.pre.alpha.pre.102 lib/renderer/json.rb
aws_security_viz-0.1.5.pre.alpha.pre.101 lib/renderer/json.rb
aws_security_viz-0.1.5.pre.alpha.pre.100 lib/renderer/json.rb
aws_security_viz-0.1.5.pre.alpha.pre.99 lib/renderer/json.rb