Sha256: f9fc5ac758b8f8576dfdf926a57ae3d755121d78c8a676dca4b1f086db331af5

Contents?: true

Size: 487 Bytes

Versions: 6

Compression:

Stored size: 487 Bytes

Contents

module Coradoc
  module Element
    class Header < Base
      attr_accessor :title, :author, :revision

      declare_children :title

      def initialize(title, options = {})
        @title = title
        @author = options.fetch(:author, nil)
        @revision = options.fetch(:revision, nil)
      end

      def to_adoc
        adoc = "= #{@title}\n"
        adoc << @author.to_adoc if @author
        adoc << @revision.to_adoc if @revision
        adoc
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

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