Class: Coradoc::Element::Revision
- Defined in:
- lib/coradoc/element/revision.rb
Instance Attribute Summary collapse
-
#date ⇒ Object
Returns the value of attribute date.
-
#number ⇒ Object
Returns the value of attribute number.
-
#remark ⇒ Object
Returns the value of attribute remark.
Instance Method Summary collapse
-
#initialize(number, options = {}) ⇒ Revision
constructor
A new instance of Revision.
- #to_adoc ⇒ Object
Methods inherited from Base
#children_accessors, children_accessors, declare_children, #simplify_block_content, visit, #visit
Constructor Details
#initialize(number, options = {}) ⇒ Revision
Returns a new instance of Revision.
8 9 10 11 12 |
# File 'lib/coradoc/element/revision.rb', line 8 def initialize(number, = {}) @number = number @date = .fetch(:date, nil) @remark = .fetch(:remark, nil) end |
Instance Attribute Details
#date ⇒ Object
Returns the value of attribute date.
4 5 6 |
# File 'lib/coradoc/element/revision.rb', line 4 def date @date end |
#number ⇒ Object
Returns the value of attribute number.
4 5 6 |
# File 'lib/coradoc/element/revision.rb', line 4 def number @number end |
#remark ⇒ Object
Returns the value of attribute remark.
4 5 6 |
# File 'lib/coradoc/element/revision.rb', line 4 def remark @remark end |
Instance Method Details
#to_adoc ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/coradoc/element/revision.rb', line 14 def to_adoc if @date.nil? && @remark.nil? "v#{@number}\n" elsif @remark.nil? "#{@number}, #{@date}\n" elsif @date.nil? "#{@number}: #{@remark}\n" else "#{@number}, #{@date}: #{@remark}\n" end end |