Class: Coradoc::Element::Header
- Inherits:
-
Object
- Object
- Coradoc::Element::Header
- Defined in:
- lib/coradoc/element/header.rb
Instance Attribute Summary collapse
-
#author ⇒ Object
readonly
Returns the value of attribute author.
-
#revision ⇒ Object
readonly
Returns the value of attribute revision.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(title, options = {}) ⇒ Header
constructor
A new instance of Header.
- #to_adoc ⇒ Object
Constructor Details
#initialize(title, options = {}) ⇒ Header
Returns a new instance of Header.
6 7 8 9 10 |
# File 'lib/coradoc/element/header.rb', line 6 def initialize(title, = {}) @title = title @author = .fetch(:author, nil) @revision = .fetch(:revision, nil) end |
Instance Attribute Details
#author ⇒ Object (readonly)
Returns the value of attribute author.
4 5 6 |
# File 'lib/coradoc/element/header.rb', line 4 def @author end |
#revision ⇒ Object (readonly)
Returns the value of attribute revision.
4 5 6 |
# File 'lib/coradoc/element/header.rb', line 4 def revision @revision end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
4 5 6 |
# File 'lib/coradoc/element/header.rb', line 4 def title @title end |
Instance Method Details
#to_adoc ⇒ Object
12 13 14 15 16 17 |
# File 'lib/coradoc/element/header.rb', line 12 def to_adoc adoc = "= #{title}\n" adoc << @author.to_adoc if @author adoc << @revision.to_adoc if @revision adoc end |