Class: Depdump::Registry::Tree::Relation
- Inherits:
-
Object
- Object
- Depdump::Registry::Tree::Relation
- Defined in:
- lib/depdump/registry/tree/relation.rb
Instance Attribute Summary collapse
-
#node ⇒ Object
readonly
Returns the value of attribute node.
-
#reference ⇒ Object
readonly
Returns the value of attribute reference.
Instance Method Summary collapse
-
#initialize(node:, reference:, search_entry_node: nil) ⇒ Relation
constructor
A new instance of Relation.
- #resolve(tree) ⇒ Object
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
#node ⇒ Object (readonly)
Returns the value of attribute node.
5 6 7 |
# File 'lib/depdump/registry/tree/relation.rb', line 5 def node @node end |
#reference ⇒ Object (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 |