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.
Instance Attribute Summary
Attributes inherited from 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.
Methods inherited from MetaMap
#[], #[]=, #ast_contents, #each, #initialize
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?, #initialize, #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
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
57 58 59 60 61 |
# File 'lib/paru/filter/meta.rb', line 57 def self.() = Meta.new {} .children = .children unless .children.nil? || .children.empty? end |
Instance Method Details
#ast_type ⇒ String
The type of a Meta is “meta”
33 34 35 |
# File 'lib/paru/filter/meta.rb', line 33 def ast_type 'meta' end |
#to_ast ⇒ Object
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_map ⇒ MetaMap
Convert this Meta node to an Paru::PandocFilter::MetaMap node
45 46 47 48 49 |
# File 'lib/paru/filter/meta.rb', line 45 def map = MetaMap.new map.children = @children map end |