Class: Kefka::MethodGraph
- Inherits:
-
Object
- Object
- Kefka::MethodGraph
- Extended by:
- Forwardable
- Defined in:
- lib/kefka.rb
Instance Method Summary collapse
-
#initialize ⇒ MethodGraph
constructor
A new instance of MethodGraph.
- #to_json ⇒ Object
Constructor Details
#initialize ⇒ MethodGraph
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_json ⇒ Object
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 |