class SevenBridges::MemoryStore
Public Class Methods
new()
click to toggle source
# File lib/seven_bridges/memory_store.rb, line 3 def initialize @nodes = {} @edges = {} end
Public Instance Methods
add_relationship(label, from, to)
click to toggle source
# File lib/seven_bridges/memory_store.rb, line 28 def add_relationship(label, from, to) @edges[{label: label, from: from[:path], to: to[:path]}] = 1 end
create_method_node(method_name, path)
click to toggle source
# File lib/seven_bridges/memory_store.rb, line 24 def create_method_node(method_name, path) @nodes[path] ||= {name: method_name, path: path, type: 'app'} end
create_test_method_node(method_name, path)
click to toggle source
# File lib/seven_bridges/memory_store.rb, line 20 def create_test_method_node(method_name, path) @nodes[path] ||= {name: method_name, path: path, type: 'test'} end
edges()
click to toggle source
# File lib/seven_bridges/memory_store.rb, line 8 def edges @edges.keys end
find_method(path)
click to toggle source
# File lib/seven_bridges/memory_store.rb, line 16 def find_method(path) @nodes[path] end
nodes()
click to toggle source
# File lib/seven_bridges/memory_store.rb, line 12 def nodes @nodes.values end