Class: Coradoc::AsciiDoc::Model::Revision
- Defined in:
- lib/coradoc/asciidoc/model/revision.rb
Overview
Revision information for document headers.
Revision metadata tracks document version numbers, dates, and remarks.
Instance Attribute Summary collapse
-
#date ⇒ Date?
readonly
The revision date.
-
#number ⇒ String?
readonly
The revision number (e.g., “1.0”, “2.1”).
-
#remark ⇒ String?
readonly
Optional revision notes.
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
#block_level?, #inline?, #serialize_content, #simplify_block_content, #to_adoc, #to_h, visit, #visit
Instance Attribute Details
#date ⇒ Date? (readonly)
Returns The revision date.
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/coradoc/asciidoc/model/revision.rb', line 27 class Revision < Base attribute :number, :string attribute :date, :date attribute :remark, :string def validate super validate_date_type end private def validate_date_type return if date.nil? || date.is_a?(Date) raise TypeError, "date must be a Date, got #{date.class}" end end |
#number ⇒ String? (readonly)
Returns The revision number (e.g., “1.0”, “2.1”).
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/coradoc/asciidoc/model/revision.rb', line 27 class Revision < Base attribute :number, :string attribute :date, :date attribute :remark, :string def validate super validate_date_type end private def validate_date_type return if date.nil? || date.is_a?(Date) raise TypeError, "date must be a Date, got #{date.class}" end end |
#remark ⇒ String? (readonly)
Returns Optional revision notes.
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/coradoc/asciidoc/model/revision.rb', line 27 class Revision < Base attribute :number, :string attribute :date, :date attribute :remark, :string def validate super validate_date_type end private def validate_date_type return if date.nil? || date.is_a?(Date) raise TypeError, "date must be a Date, got #{date.class}" end end |
Instance Method Details
#validate ⇒ Object
32 33 34 35 |
# File 'lib/coradoc/asciidoc/model/revision.rb', line 32 def validate super validate_date_type end |