Class: Paru::PandocFilter::Version

Inherits:
Node
  • Object
show all
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

Constructor Details

#initialize(contents) ⇒ Version

Create a Version node based on contents

revision number

Parameters:

  • contents (Array<Integer>)

    a list with api, major, minor,



31
32
33
# File 'lib/paru/filter/version.rb', line 31

def initialize(contents)
    @api, @major, @minor, @revision = contents
end

Instance Method Details

#ast_typeObject

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_astObject

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