Class: AsciidoctorBibtex::CitationItem
- Inherits:
-
Object
- Object
- AsciidoctorBibtex::CitationItem
- Defined in:
- lib/asciidoctor-bibtex/citation_macro.rb
Overview
CitationItem
A class to hold data for a single citation item.
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#locator ⇒ Object
readonly
Returns the value of attribute locator.
Instance Method Summary collapse
-
#initialize(key, locator) ⇒ CitationItem
constructor
A new instance of CitationItem.
- #to_s ⇒ Object
Constructor Details
#initialize(key, locator) ⇒ CitationItem
Returns a new instance of CitationItem.
18 19 20 21 22 23 24 |
# File 'lib/asciidoctor-bibtex/citation_macro.rb', line 18 def initialize(key, locator) @key = key @locator = locator # clean up locator @locator ||= '' @locator = @locator.gsub('--', '-') end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
16 17 18 |
# File 'lib/asciidoctor-bibtex/citation_macro.rb', line 16 def key @key end |
#locator ⇒ Object (readonly)
Returns the value of attribute locator.
16 17 18 |
# File 'lib/asciidoctor-bibtex/citation_macro.rb', line 16 def locator @locator end |
Instance Method Details
#to_s ⇒ Object
26 27 28 |
# File 'lib/asciidoctor-bibtex/citation_macro.rb', line 26 def to_s "#{@key}:#{@locator}" end |