Class: Glossarist::BibliographicReference

Inherits:
Object
  • Object
show all
Includes:
Reference
Defined in:
lib/glossarist/bibliographic_reference.rb

Overview

A reference to a bibliographic entry (an external document), distinct from a ConceptReference (a cross-reference to another concept in the same or another registry).

BibliographicReference is produced by ReferenceExtractor from AsciiDoc <> xrefs and from model-level source citations. It participates in the Reference protocol so validation rules iterating mixed reference collections can call cite? / local? / external? without type-checking. All three predicates default to false (a bibliographic reference is never an inline {{cite:id}} mention, never a concept cross-ref).

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Reference

#cite?, #external?, #local?

Constructor Details

#initialize(anchor:, location: nil) ⇒ BibliographicReference

Returns a new instance of BibliographicReference.



20
21
22
23
# File 'lib/glossarist/bibliographic_reference.rb', line 20

def initialize(anchor:, location: nil)
  @anchor = anchor
  @location = location
end

Instance Attribute Details

#anchorObject (readonly)

Returns the value of attribute anchor.



18
19
20
# File 'lib/glossarist/bibliographic_reference.rb', line 18

def anchor
  @anchor
end

#locationObject (readonly)

Returns the value of attribute location.



18
19
20
# File 'lib/glossarist/bibliographic_reference.rb', line 18

def location
  @location
end

Instance Method Details

#dedup_keyObject



25
26
27
# File 'lib/glossarist/bibliographic_reference.rb', line 25

def dedup_key
  anchor
end