Class: Kefka::MethodGraph

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/kefka.rb

Instance Method Summary collapse

Constructor Details

#initializeMethodGraph

Returns a new instance of MethodGraph.



87
88
89
# File 'lib/kefka.rb', line 87

def initialize
  @graph =  RGL::DirectedAdjacencyGraph.new
end

Instance Method Details

#to_jsonObject



91
92
93
94
95
96
97
98
99
100
101
# File 'lib/kefka.rb', line 91

def to_json
  {
    :vertices => vertices,
    :edges => edges.map { |edge|
      {
        :source => edge.source.key,
        :target => edge.target.key
      }
    }
  }.to_json
end