Class: Paru::PandocFilter::Meta

Inherits:
MetaMap show all
Defined in:
lib/paru/filter/meta.rb

Overview

A Meta node represents the metadata of a document. It is a MetaMap node.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

This class inherits a constructor from Paru::PandocFilter::MetaMap

Class Method Details

.from_meta_map(meta_map) ⇒ Meta

Parameters:

Returns:



57
58
59
60
61
# File 'lib/paru/filter/meta.rb', line 57

def self.from_meta_map(meta_map)
  meta = Meta.new {}
  meta.children = meta_map.children unless meta_map.children.nil? || meta_map.children.empty?
  meta
end

Instance Method Details

#ast_typeString

The type of a Meta is “meta”

Returns:

  • (String)

    “meta”



33
34
35
# File 'lib/paru/filter/meta.rb', line 33

def ast_type
  'meta'
end

#to_astObject

Convert this Meta node to an AST representation



38
39
40
# File 'lib/paru/filter/meta.rb', line 38

def to_ast
  ast_contents
end

#to_meta_mapMetaMap

Convert this Meta node to an Paru::PandocFilter::MetaMap node

Returns:

  • (MetaMap)

    a MetaMap representation of this metadata



45
46
47
48
49
# File 'lib/paru/filter/meta.rb', line 45

def to_meta_map
  map = MetaMap.new
  map.children = @children
  map
end