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.5.pre.alpha.pre.97 lib/renderer/json.rb
aws_security_viz-0.1.5 lib/renderer/json.rb
aws_security_viz-0.1.5.pre.alpha.pre.95 lib/renderer/json.rb
aws_security_viz-0.1.5.pre.alpha.pre.94 lib/renderer/json.rb
aws_security_viz-0.1.5.pre.alpha.pre.93 lib/renderer/json.rb
aws_security_viz-0.1.5.pre.alpha.pre.91 lib/renderer/json.rb
aws_security_viz-0.1.5.pre.alpha.pre.90 lib/renderer/json.rb
aws_security_viz-0.1.5.pre.alpha.pre.89 lib/renderer/json.rb
aws_security_viz-0.1.5.pre.alpha.pre.87 lib/renderer/json.rb
aws_security_viz-0.1.5.pre.alpha.pre.85 lib/renderer/json.rb
aws_security_viz-0.1.5.pre.alpha.pre.84 lib/renderer/json.rb
aws_security_viz-0.1.5.pre.alpha.pre.83 lib/renderer/json.rb
aws_security_viz-0.1.4 lib/renderer/json.rb
aws_security_viz-0.1.4.pre.alpha.pre.82 lib/renderer/json.rb
aws_security_viz-0.1.4.pre.alpha.pre.81 lib/renderer/json.rb
aws_security_viz-0.1.4.pre.alpha.pre.77 lib/renderer/json.rb
aws_security_viz-0.1.4.pre.alpha.pre.75 lib/renderer/json.rb
aws_security_viz-0.1.4.pre.alpha.pre.73 lib/renderer/json.rb
aws_security_viz-0.1.3 lib/renderer/json.rb
aws_security_viz-0.1.3.pre.alpha.pre.71 lib/renderer/json.rb