Class: Glossarist::ConceptSet

Inherits:
Object
  • Object
show all
Defined in:
lib/glossarist/concept_set.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(concepts, assets, options = {}) ⇒ ConceptSet

Returns a new instance of ConceptSet.



18
19
20
21
22
23
24
25
26
# File 'lib/glossarist/concept_set.rb', line 18

def initialize(concepts, assets, options = {})
  @concepts = read_concepts(concepts)
  @assets = Glossarist::Collections::AssetCollection.new(assets)
  @bibliographies = Glossarist::Collections::BibliographyCollection.new(
    @concepts,
    options.dig(:bibliography, :global_cache),
    options.dig(:bibliography, :local_cache),
  )
end

Instance Attribute Details

#assetsObject

an ‘Collections::Asset` object



12
13
14
# File 'lib/glossarist/concept_set.rb', line 12

def assets
  @assets
end

#bibliographiesObject

a ‘BibliographyCollection` object



9
10
11
# File 'lib/glossarist/concept_set.rb', line 9

def bibliographies
  @bibliographies
end

#conceptsObject

a ‘Glossarist::ManagedConceptCollection` object



6
7
8
# File 'lib/glossarist/concept_set.rb', line 6

def concepts
  @concepts
end

Instance Method Details

#to_latex(filename = nil) ⇒ Object



28
29
30
31
32
33
34
# File 'lib/glossarist/concept_set.rb', line 28

def to_latex(filename = nil)
  return to_latex_from_file(filename) if filename

  @concepts.map do |concept|
    latex_template(concept)
  end.join("\n")
end