Class: SimpleResolveStrategy

Inherits:
ResolveStrategy show all
Defined in:
lib/exploration/resolve/simple_resolve_strategy.rb

Overview

The SimpleResolveStrategy assumes any vertex with the same name and a namespace that includes or is included by the other represents the same entity regardless of the namespace of the entity or paths where the entity is declared.

Instance Method Summary collapse

Methods inherited from ResolveStrategy

#merge_vertices, #rereference_incoming_edges!

Instance Method Details

#is_same?(v1, v2) ⇒ Boolean

Returns true if v1 and v2 represent the same vertex based on the Simple Resolve Strategy v1, v2 are Vertex objects

Returns:

  • (Boolean)


8
9
10
11
12
13
# File 'lib/exploration/resolve/simple_resolve_strategy.rb', line 8

def is_same? v1, v2
  v1.name.eql?(v2.name) && (
                            v1.namespace.is_included_by?(v2.namespace) ||
                            v1.namespace.does_include?(v2.namespace)
                            )
end