Sha256: e40b229e84b9ed135c6e4f98d92c21f12961c231d5c15a67c9526e3acf286232

Contents?: true

Size: 704 Bytes

Versions: 6

Compression:

Stored size: 704 Bytes

Contents

module Coradoc
  module Element
    class BibliographyEntry < Base
      attr_accessor :anchor_name, :document_id, :ref_text, :line_break

      def initialize(options = {})
        @anchor_name = options.fetch(:anchor_name, nil)
        @document_id = options.fetch(:document_id, nil)
        @ref_text = options.fetch(:ref_text, nil)
        @line_break = options.fetch(:line_break, "")
      end

      def to_adoc
        text = Coradoc::Generator.gen_adoc(@ref_text) if @ref_text
        adoc = "* [[[#{@anchor_name}"
        adoc << ",#{@document_id}" if @document_id
        adoc << "]]]"
        adoc << "#{text}" if @ref_text
        adoc << @line_break
        adoc
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
coradoc-1.1.6 lib/coradoc/element/bibliography_entry.rb
coradoc-1.1.5 lib/coradoc/element/bibliography_entry.rb
coradoc-1.1.4 lib/coradoc/element/bibliography_entry.rb
coradoc-1.1.3 lib/coradoc/element/bibliography_entry.rb
coradoc-1.1.2 lib/coradoc/element/bibliography_entry.rb
coradoc-1.1.1 lib/coradoc/element/bibliography_entry.rb