Class: Coradoc::Element::Author
- Defined in:
- lib/coradoc/element/author.rb
Instance Attribute Summary collapse
-
#email ⇒ Object
Returns the value of attribute email.
-
#first_name ⇒ Object
Returns the value of attribute first_name.
-
#last_name ⇒ Object
Returns the value of attribute last_name.
Instance Method Summary collapse
-
#initialize(first_name, last_name, email, middle_name = nil) ⇒ Author
constructor
A new instance of Author.
- #to_adoc ⇒ Object
Methods inherited from Base
#children_accessors, children_accessors, declare_children, #simplify_block_content, visit, #visit
Constructor Details
#initialize(first_name, last_name, email, middle_name = nil) ⇒ Author
Returns a new instance of Author.
8 9 10 11 12 13 |
# File 'lib/coradoc/element/author.rb', line 8 def initialize(first_name, last_name, email, middle_name = nil) @first_name = first_name @last_name = last_name @email = email @middle_name = middle_name end |
Instance Attribute Details
#email ⇒ Object
Returns the value of attribute email.
4 5 6 |
# File 'lib/coradoc/element/author.rb', line 4 def email @email end |
#first_name ⇒ Object
Returns the value of attribute first_name.
4 5 6 |
# File 'lib/coradoc/element/author.rb', line 4 def first_name @first_name end |
#last_name ⇒ Object
Returns the value of attribute last_name.
4 5 6 |
# File 'lib/coradoc/element/author.rb', line 4 def last_name @last_name end |
Instance Method Details
#to_adoc ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/coradoc/element/author.rb', line 15 def to_adoc adoc = "#{@first_name}" adoc << " #{@middle_name}" if @middle_name adoc << " #{@last_name.to_s}" adoc << " <#{@email}>\n" if @email adoc end |