Class: Depdump::Registry::Tree::Relation

Inherits:
Object
  • Object
show all
Defined in:
lib/depdump/registry/tree/relation.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(node:, reference:, search_entry_node: nil) ⇒ Relation

Returns a new instance of Relation.



7
8
9
10
11
# File 'lib/depdump/registry/tree/relation.rb', line 7

def initialize(node:, reference:, search_entry_node: nil)
  @node = node
  @reference = reference
  @search_entry_node = search_entry_node || node
end

Instance Attribute Details

#nodeObject (readonly)

Returns the value of attribute node.



5
6
7
# File 'lib/depdump/registry/tree/relation.rb', line 5

def node
  @node
end

#referenceObject (readonly)

Returns the value of attribute reference.



5
6
7
# File 'lib/depdump/registry/tree/relation.rb', line 5

def reference
  @reference
end

Instance Method Details

#resolve(tree) ⇒ Object



13
14
15
16
# File 'lib/depdump/registry/tree/relation.rb', line 13

def resolve(tree)
  resolved_node = tree.resolve(reference, @search_entry_node)
  resolved_node&.namespaces
end