Class: Paru::PandocFilter::Span

Inherits:
Inline show all
Defined in:
lib/paru/filter/span.rb

Overview

A Span node is a general Inline level node with attributes and contens

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(contents) ⇒ Span

Create a new Span node based on the contents

Parameters:

  • contents (Array)


35
36
37
38
# File 'lib/paru/filter/span.rb', line 35

def initialize(contents)
    @attr = Attr.new contents[0]
    super contents[1]
end

Instance Attribute Details

#attrAttr

Returns:



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/span.rb', line 29

class Span < Inline
    attr_accessor :attr

    # Create a new Span node based on the contents
    #
    # @param contents [Array]
    def initialize(contents)
        @attr = Attr.new contents[0]
        super contents[1]
    end

    # The AST contents
    #
    # @return [Array]
    def ast_contents()
        [
            @attr.to_ast,
            super
        ]
    end
end

Instance Method Details

#ast_contentsArray

The AST contents

Returns:

  • (Array)


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

def ast_contents()
    [
        @attr.to_ast,
        super
    ]
end