Sha256: 139e6aac3d7fbb7e6bb43daacee4f4158e8c5a237b2dd99cb2c03852e480466d
Contents?: true
Size: 583 Bytes
Versions: 6
Compression:
Stored size: 583 Bytes
Contents
module Coradoc module Element class Bibliography < Base attr_accessor :id, :title, :entries def initialize(options = {}) @id = options.fetch(:id, nil) @anchor = @id.nil? ? nil : Inline::Anchor.new(@id) @title = options.fetch(:title, nil) @entries = options.fetch(:entries,nil) end def to_adoc adoc = "#{gen_anchor}\n" adoc << "[bibliography]" adoc << "== #{@title}\n\n" @entries.each do |entry| adoc << "#{entry.to_adoc}\n" end adoc end end end end
Version data entries
6 entries across 6 versions & 1 rubygems