class Sequel::ToDot

Constants

TO_DOT_OPTIONS

The option keys that should be included in the dot output.

Public Class Methods

new(ds) click to toggle source

Given a Dataset, parse the internal structure to generate a dataset visualization.

   # File lib/sequel/extensions/to_dot.rb
37 def initialize(ds)
38   @i = 0
39   @stack = [@i]
40   @dot = ["digraph G {", "0 [label=\"self\"];"]
41   v(ds, "")
42   @dot << "}"
43 end
output(ds) click to toggle source

Given a Dataset, return a string in dot format that will generate a visualization of the dataset.

   # File lib/sequel/extensions/to_dot.rb
31 def self.output(ds)
32   new(ds).output
33 end

Public Instance Methods

output() click to toggle source

Output the dataset visualization as a string in dot format.

   # File lib/sequel/extensions/to_dot.rb
46 def output
47   @dot.join("\n")
48 end