Class: Kefka::LineGraph
Overview
shows which line in a method called which method
Instance Method Summary collapse
- #add_edge(u, v) ⇒ Object
- #edges ⇒ Object
-
#initialize ⇒ LineGraph
constructor
A new instance of LineGraph.
Constructor Details
#initialize ⇒ LineGraph
Returns a new instance of LineGraph.
151 152 153 |
# File 'lib/kefka.rb', line 151 def initialize @graph = RGL::DirectedAdjacencyGraph.new end |
Instance Method Details
#add_edge(u, v) ⇒ Object
155 156 157 158 |
# File 'lib/kefka.rb', line 155 def add_edge(u,v) raise ArgumentError unless Call === u && Method === v @graph.add_edge(u,v) end |
#edges ⇒ Object
160 161 162 163 164 165 166 167 |
# File 'lib/kefka.rb', line 160 def edges @graph.edges.map { |edge| { :source => edge.source.key, :target => edge.target.key } } end |