class AsciidoctorBibliography::CitationItem

Constants

LOCATORS

Attributes

key[RW]
named_attributes[RW]
positional_attributes[RW]
target[RW]

Public Class Methods

new() { |self| ... } click to toggle source
# File lib/asciidoctor-bibliography/citation_item.rb, line 9
def initialize
  yield self if block_given?
end

Public Instance Methods

locator() click to toggle source
# File lib/asciidoctor-bibliography/citation_item.rb, line 29
def locator
  locators.first
end
locators() click to toggle source
# File lib/asciidoctor-bibliography/citation_item.rb, line 25
def locators
  named_attributes.select { |key, _| LOCATORS.include? key }
end
parse_attribute_list(string) click to toggle source
# File lib/asciidoctor-bibliography/citation_item.rb, line 33
def parse_attribute_list(string)
  parsed_attributes = ::Asciidoctor::AttributeList.new(string).parse
  self.named_attributes = parsed_attributes.reject { |key, _| key.is_a? Integer }
  self.positional_attributes = parsed_attributes.select { |key, _| key.is_a? Integer }.values
  self.key = positional_attributes.shift
end
prefix() click to toggle source
# File lib/asciidoctor-bibliography/citation_item.rb, line 13
def prefix
  named_attributes["prefix"]
end
suffix() click to toggle source
# File lib/asciidoctor-bibliography/citation_item.rb, line 17
def suffix
  named_attributes["suffix"]
end
text() click to toggle source
# File lib/asciidoctor-bibliography/citation_item.rb, line 21
def text
  named_attributes["text"]
end