Module: Glossarist::Reference

Included in:
AssetReference, BibliographicReference, ConceptReference, NonVerbalReference
Defined in:
lib/glossarist/reference.rb

Overview

Shared protocol for all reference kinds produced by ReferenceExtractor.

ConceptReference, BibliographicReference, AssetReference, and the NonVerbalReference family (Figure/Table/Formula) all participate in validation rules that iterate a mixed collection extracted from a concept's text fields. Rules such as CiteRefIntegrityRule call select(&:cite?) on these mixed collections and must not crash on any member.

The defaults here represent the common case: most reference kinds are neither inline {{cite:...}} mentions, nor local/external concept cross-refs. ConceptReference overrides all three predicates because its semantics depend on ref_type and source.

Including this module in a new reference class is sufficient to make it participate correctly in mixed-collection validation rules.

Instance Method Summary collapse

Instance Method Details

#cite?Boolean

Returns:

  • (Boolean)


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

def cite?
  false
end

#external?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/glossarist/reference.rb', line 29

def external?
  false
end

#local?Boolean

Returns:

  • (Boolean)


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

def local?
  false
end