Class: Coradoc::CoreModel::Bibliography

Inherits:
Base
  • Object
show all
Defined in:
lib/coradoc/core_model/bibliography.rb

Overview

Bibliography section in a document.

Bibliography sections contain lists of references cited in the document. They are typically marked with [bibliography] attribute in AsciiDoc.

Examples:

Create a bibliography section

bib = Coradoc::CoreModel::Bibliography.new(
  id: "norm-refs",
  title: "Normative references",
  entries: [
    Coradoc::CoreModel::BibliographyEntry.new(
      anchor_name: "ISO712",
      document_id: "ISO 712",
      ref_text: "Cereals and cereal products..."
    )
  ]
)

Instance Attribute Summary collapse

Attributes inherited from Base

#element_attributes, #metadata_entries

Method Summary

Methods inherited from Base

#accept, #attr, #metadata, #semantically_equivalent?, #set_attr, #set_metadata

Instance Attribute Details

#entriesArray<Coradoc::CoreModel::BibliographyEntry> (readonly)

Returns Bibliography entries.

Returns:



35
36
37
38
39
40
# File 'lib/coradoc/core_model/bibliography.rb', line 35

class Bibliography < Base
  attribute :id, :string
  attribute :title, :string
  attribute :level, :integer
  attribute :entries, Coradoc::CoreModel::BibliographyEntry, collection: true
end

#idString? (readonly)

Returns Optional identifier for the bibliography.

Returns:

  • (String, nil)

    Optional identifier for the bibliography



35
36
37
38
39
40
# File 'lib/coradoc/core_model/bibliography.rb', line 35

class Bibliography < Base
  attribute :id, :string
  attribute :title, :string
  attribute :level, :integer
  attribute :entries, Coradoc::CoreModel::BibliographyEntry, collection: true
end

#levelInteger? (readonly)

Returns Section level.

Returns:

  • (Integer, nil)

    Section level



35
36
37
38
39
40
# File 'lib/coradoc/core_model/bibliography.rb', line 35

class Bibliography < Base
  attribute :id, :string
  attribute :title, :string
  attribute :level, :integer
  attribute :entries, Coradoc::CoreModel::BibliographyEntry, collection: true
end

#titleString? (readonly)

Returns Bibliography section title.

Returns:

  • (String, nil)

    Bibliography section title



35
36
37
38
39
40
# File 'lib/coradoc/core_model/bibliography.rb', line 35

class Bibliography < Base
  attribute :id, :string
  attribute :title, :string
  attribute :level, :integer
  attribute :entries, Coradoc::CoreModel::BibliographyEntry, collection: true
end