Class: Glossarist::ResolutionAdapter::Package
- Inherits:
-
Glossarist::ResolutionAdapter
- Object
- Glossarist::ResolutionAdapter
- Glossarist::ResolutionAdapter::Package
- Defined in:
- lib/glossarist/resolution_adapter/package.rb
Instance Attribute Summary collapse
-
#local_adapter ⇒ Object
readonly
Returns the value of attribute local_adapter.
-
#uri_prefix ⇒ Object
readonly
Returns the value of attribute uri_prefix.
Instance Method Summary collapse
-
#initialize(concepts, uri_prefix:) ⇒ Package
constructor
A new instance of Package.
- #resolve(reference) ⇒ Object
Constructor Details
Instance Attribute Details
#local_adapter ⇒ Object (readonly)
Returns the value of attribute local_adapter.
6 7 8 |
# File 'lib/glossarist/resolution_adapter/package.rb', line 6 def local_adapter @local_adapter end |
#uri_prefix ⇒ Object (readonly)
Returns the value of attribute uri_prefix.
6 7 8 |
# File 'lib/glossarist/resolution_adapter/package.rb', line 6 def uri_prefix @uri_prefix end |
Instance Method Details
#resolve(reference) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/glossarist/resolution_adapter/package.rb', line 14 def resolve(reference) return nil unless reference.ref_type == "urn" return nil unless reference.source == uri_prefix @local_adapter.resolve_by_id(reference.concept_id) end |