Sha256: a633d2e6fa4f8342cef78ada642adcd02a0356204231b3bd60d249be248cb15f

Contents?: true

Size: 588 Bytes

Versions: 3

Compression:

Stored size: 588 Bytes

Contents

module RTFM
  class AuthorsSection
    def initialize
      @authors = []
      yield self if block_given?
    end
    def add_author(name, email = nil)
      @authors << {:name => name, :email => email}
    end
    alias_method :author, :add_author
    alias_method :add, :add_author
    
    def to_groff
      GroffString.groffify do |out|
        out.section "authors"
        @authors.each do |author|
          args = ["\"#{author[:name]}\""]
          if author[:email] then args << "Aq" << author[:email] end
          out.An *args
        end
      end
    end
  end
end
        

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rtfm-0.5.2 lib/rtfm/sections/authors.rb
rtfm-0.5.1 lib/rtfm/sections/authors.rb
rtfm-0.5.0 lib/rtfm/sections/authors.rb