Class: Glossarist::ResolutionAdapter::Bibliography
- Inherits:
-
Glossarist::ResolutionAdapter
- Object
- Glossarist::ResolutionAdapter
- Glossarist::ResolutionAdapter::Bibliography
- Defined in:
- lib/glossarist/resolution_adapter/bibliography.rb
Instance Attribute Summary collapse
-
#concepts ⇒ Object
readonly
Returns the value of attribute concepts.
-
#source_id ⇒ Object
readonly
Returns the value of attribute source_id.
Instance Method Summary collapse
-
#initialize(source_id, concepts) ⇒ Bibliography
constructor
A new instance of Bibliography.
- #resolve(reference) ⇒ Object
Constructor Details
#initialize(source_id, concepts) ⇒ Bibliography
Returns a new instance of Bibliography.
8 9 10 11 12 |
# File 'lib/glossarist/resolution_adapter/bibliography.rb', line 8 def initialize(source_id, concepts) super() @source_id = source_id @concepts = concepts end |
Instance Attribute Details
#concepts ⇒ Object (readonly)
Returns the value of attribute concepts.
6 7 8 |
# File 'lib/glossarist/resolution_adapter/bibliography.rb', line 6 def concepts @concepts end |
#source_id ⇒ Object (readonly)
Returns the value of attribute source_id.
6 7 8 |
# File 'lib/glossarist/resolution_adapter/bibliography.rb', line 6 def source_id @source_id end |
Instance Method Details
#resolve(reference) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/glossarist/resolution_adapter/bibliography.rb', line 14 def resolve(reference) return nil unless reference.is_a?(ConceptReference) return nil unless reference.source == @source_id concepts.by_id_and(reference.concept_id, reference.version) end |