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 Attribute Summary

Attributes inherited from Node

#children, #parent

Instance Method Summary collapse

Methods inherited from Node

#ast_contents, #can_act_as_both_block_and_inline?, #each, from_markdown, #get_replacement, #has_been_replaced?, #has_block?, #has_children?, #has_class?, #has_inline?, #has_parent?, #has_string?, #is_block?, #is_inline?, #is_leaf?, #is_node?, #is_root?, #markdown, #markdown=, #toMetadata, #to_s, #type

Methods included from ASTManipulation

#append, #delete, #each_depth_first, #find_index, #get, #insert, #prepend, #remove_at, #replace, #replace_at

Constructor Details

#initialize(contents) ⇒ Version

Create a Version node based on contents

revision number

Parameters:

  • contents (Array<Integer>)

    a list with api, major, minor,



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

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

Instance Method Details

#ast_typeObject

The AST type is "pandoc-api-version"



37
38
39
# File 'lib/paru/filter/version.rb', line 37

def ast_type
  'pandoc-api-version'
end

#to_astObject

Create an AST representation of this Version



42
43
44
# File 'lib/paru/filter/version.rb', line 42

def to_ast
  [@api, @major, @minor, @revision].compact
end