Class: Coradoc::Reference::Result::Base
- Inherits:
-
Lutaml::Model::Serializable
- Object
- Lutaml::Model::Serializable
- Coradoc::Reference::Result::Base
- Defined in:
- lib/coradoc/reference/result/base.rb
Overview
Base class for resolution outcomes. Subclasses are value types. Every Result carries the Edge that asked — so callers can log, trace, and re-route without re-resolving.
Instance Method Summary collapse
- #ambiguous? ⇒ Boolean
-
#for_edge(edge) ⇒ Object
This Result as seen by
edge. - #missing? ⇒ Boolean
- #resolved? ⇒ Boolean
Instance Method Details
#ambiguous? ⇒ Boolean
19 20 21 |
# File 'lib/coradoc/reference/result/base.rb', line 19 def ambiguous? is_a?(Result::Ambiguous) end |
#for_edge(edge) ⇒ Object
This Result as seen by edge. Returns self when the edge is
value-equal to the one embedded; otherwise rebuilds the same
outcome (target/candidates preserved) for the asking edge.
Used by caching resolvers so two edges sharing an Address
never see each other's identity.
32 33 34 35 36 |
# File 'lib/coradoc/reference/result/base.rb', line 32 def for_edge(edge) return self if self.edge == edge self.class.build(edge: edge, address: address, **result_data) end |