Class: Paru::PandocFilter::Quoted

Inherits:
Inline show all
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

["SingleQuote", "DoubleQuote"]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(contents) ⇒ Quoted

Create a new Quote node based on the contents

Parameters:

  • contents (Array)


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

def initialize(contents)
    @quote_type = contents[0]
    super contents[1]
end

Instance Attribute Details

#quote_typeQUOTE_TYPE

Returns:



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/paru/filter/quoted.rb', line 28

class Quoted < Inline
    # A quote is either a single quote or a double quote
    QUOTE_TYPE = ["SingleQuote", "DoubleQuote"]

    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_contentsObject

The AST contents of a Quote node



43
44
45
46
47
48
# File 'lib/paru/filter/quoted.rb', line 43

def ast_contents()
    [
        @quote_type,
        super
    ]
end