Class: Paru::PandocFilter::Meta
- 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
-
#ast_type ⇒ String
The type of a Meta is “meta”.
-
#to_ast ⇒ Object
Convert this Meta node to an AST representation.
-
#to_meta_map ⇒ MetaMap
Convert this Meta node to an MetaMap node.
Constructor Details
This class inherits a constructor from Paru::PandocFilter::MetaMap
Class Method Details
.from_meta_map(meta_map) ⇒ Meta
Convert a Paru::PandocFilter::MetaMap node to a Paru::PandocFilter::Meta node
55 56 57 58 59 |
# File 'lib/paru/filter/meta.rb', line 55 def self.() = Meta.new {} .children = .children unless .children.nil? or .children.empty? end |
Instance Method Details
#ast_type ⇒ String
The type of a Meta is “meta”
31 32 33 |
# File 'lib/paru/filter/meta.rb', line 31 def ast_type() "meta" end |
#to_ast ⇒ Object
Convert this Meta node to an AST representation
36 37 38 |
# File 'lib/paru/filter/meta.rb', line 36 def to_ast() ast_contents end |
#to_meta_map ⇒ MetaMap
Convert this Meta node to an Paru::PandocFilter::MetaMap node
43 44 45 46 47 |
# File 'lib/paru/filter/meta.rb', line 43 def () map = MetaMap.new map.children = @children map end |