Class: RTFM::AuthorsSection
- Inherits:
-
Object
- Object
- RTFM::AuthorsSection
- Defined in:
- lib/rtfm/sections/authors.rb
Instance Method Summary collapse
- #add_author(name, email = nil) ⇒ Object (also: #author, #add)
-
#initialize {|_self| ... } ⇒ AuthorsSection
constructor
A new instance of AuthorsSection.
- #to_groff ⇒ Object
Constructor Details
#initialize {|_self| ... } ⇒ AuthorsSection
Returns a new instance of AuthorsSection.
3 4 5 6 |
# File 'lib/rtfm/sections/authors.rb', line 3 def initialize @authors = [] yield self if block_given? end |
Instance Method Details
#add_author(name, email = nil) ⇒ Object Also known as: add ,
7 8 9 |
# File 'lib/rtfm/sections/authors.rb', line 7 def (name, email = nil) @authors << {:name => name, :email => email} end |
#to_groff ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/rtfm/sections/authors.rb', line 13 def to_groff GroffString.groffify do |out| out.section "authors" @authors.each do || args = ["\"#{[:name]}\""] if [:email] then args << "Aq" << [:email] end out.An *args end end end |