Class: AsciidocBib::CitationData

Inherits:
Object
  • Object
show all
Defined in:
lib/asciidoc-bib/citationdata.rb

Overview

Holds information about a citation in text: the text forming the citation, its type, pretext, and enclosed cites.

For example, the citation: "[cite:See:Lane12,59;Lane11]"

  • original: "[cite:See:Lane12,59;Lane11]"
  • type: "cite"
  • pretext: "See"
  • cites: [Citationref="Lane12",pages="59", Citationref="Lane11",pages="" ]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(original, type, pretext, cites) ⇒ CitationData

Returns a new instance of CitationData.



22
23
24
25
26
27
28
29
30
31
# File 'lib/asciidoc-bib/citationdata.rb', line 22

def initialize original, type, pretext, cites
  @original = original
  @type = type
  @pretext = if pretext.nil?
               ''
             else
               pretext
             end
  @cites = cites
end

Instance Attribute Details

#citesObject (readonly)

List of Citation instances, defining each cite.



20
21
22
# File 'lib/asciidoc-bib/citationdata.rb', line 20

def cites
  @cites
end

#originalObject (readonly)

Original text defining this set of citations.



14
15
16
# File 'lib/asciidoc-bib/citationdata.rb', line 14

def original
  @original
end

#pretextObject (readonly)

Any pretext given for the citation (e.g. 'See').



18
19
20
# File 'lib/asciidoc-bib/citationdata.rb', line 18

def pretext
  @pretext
end

#typeObject (readonly)

The type of citation (e.g. 'cite', 'citenp').



16
17
18
# File 'lib/asciidoc-bib/citationdata.rb', line 16

def type
  @type
end