Class: Paru::PandocFilter::Quoted
- Defined in:
- lib/paru/filter/quoted.rb
Overview
A Quoted node represents a quote with a type and the contents of the quote
Constant Summary collapse
- QUOTE_TYPE =
A quote is either a single quote or a double quote
%w[SingleQuote DoubleQuote].freeze
Instance Attribute Summary collapse
Attributes inherited from Node
Instance Method Summary collapse
-
#ast_contents ⇒ Object
The AST contents of a Quote node.
-
#initialize(contents) ⇒ Quoted
constructor
Create a new Quote node based on the contents.
Methods inherited from Inline
Methods included from InnerMarkdown
#inner_markdown, #inner_markdown=
Methods inherited from Node
#ast_type, #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_ast, #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) ⇒ Quoted
Create a new Quote node based on the contents
39 40 41 42 |
# File 'lib/paru/filter/quoted.rb', line 39 def initialize(contents) @quote_type = contents[0] super(contents[1]) end |
Instance Attribute Details
#quote_type ⇒ QUOTE_TYPE
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/paru/filter/quoted.rb', line 30 class Quoted < Inline # A quote is either a single quote or a double quote QUOTE_TYPE = %w[SingleQuote DoubleQuote].freeze attr_accessor :quote_type # Create a new Quote node based on the contents # # @param contents [Array] def initialize(contents) @quote_type = contents[0] super(contents[1]) end # The AST contents of a Quote node def ast_contents [ @quote_type, super ] end end |
Instance Method Details
#ast_contents ⇒ Object
The AST contents of a Quote node
45 46 47 48 49 50 |
# File 'lib/paru/filter/quoted.rb', line 45 def ast_contents [ @quote_type, super ] end |