Class: Paru::PandocFilter::Version
- Defined in:
- lib/paru/filter/version.rb
Overview
Version is a general Node containing the pandoc-api-version. It has the format major.minor.revision.sub
Instance Method Summary collapse
-
#ast_type ⇒ Object
The AST type is “pandoc-api-version”.
-
#initialize(contents) ⇒ Version
constructor
Create a Version node based on contents.
-
#to_ast ⇒ Object
Create an AST representation of this Version.
Constructor Details
#initialize(contents) ⇒ Version
Create a Version node based on contents
revision number
31 32 33 |
# File 'lib/paru/filter/version.rb', line 31 def initialize(contents) @api, @major, @minor, @revision = contents end |
Instance Method Details
#ast_type ⇒ Object
The AST type is “pandoc-api-version”
36 37 38 |
# File 'lib/paru/filter/version.rb', line 36 def ast_type "pandoc-api-version" end |
#to_ast ⇒ Object
Create an AST representation of this Version
41 42 43 |
# File 'lib/paru/filter/version.rb', line 41 def to_ast() [@api, @major, @minor, @revision].select {|v| !v.nil?} end |