Class: Paru::PandocFilter::RawInline

Inherits:
Inline
  • Object
show all
Defined in:
lib/paru/filter/raw_inline.rb

Overview

A RawInline node has a format and a string value

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(contents) ⇒ RawInline

Create a new RawInline node based on the contents

Parameters:

  • contents (Array)


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

def initialize(contents)
    @format, @string = contents
end

Instance Attribute Details

#formatString

Returns:

  • (String)


30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/paru/filter/raw_inline.rb', line 30

class RawInline < Inline
    attr_accessor :format, :string

    # Create a new RawInline node based on the contents
    #
    # @param contents [Array]
    def initialize(contents)
        @format, @string = contents
    end

    # The AST contents
    #
    # @return [Array]
    def ast_contents()
        [
            @format,
            @string
        ]
    end

    # Has this RawInline a string value?
    #
    # @return [Boolean] true
    def has_string?()
        true
    end

    # Has this RawInline inline contents?
    #
    # @return [Boolean] false
    def has_inline?()
        false
    end
end

#stringString

Returns:

  • (String)


30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/paru/filter/raw_inline.rb', line 30

class RawInline < Inline
    attr_accessor :format, :string

    # Create a new RawInline node based on the contents
    #
    # @param contents [Array]
    def initialize(contents)
        @format, @string = contents
    end

    # The AST contents
    #
    # @return [Array]
    def ast_contents()
        [
            @format,
            @string
        ]
    end

    # Has this RawInline a string value?
    #
    # @return [Boolean] true
    def has_string?()
        true
    end

    # Has this RawInline inline contents?
    #
    # @return [Boolean] false
    def has_inline?()
        false
    end
end

Instance Method Details

#ast_contentsArray

The AST contents

Returns:

  • (Array)


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

def ast_contents()
    [
        @format,
        @string
    ]
end

#has_inline?Boolean

Has this RawInline inline contents?

Returns:

  • (Boolean)

    false



60
61
62
# File 'lib/paru/filter/raw_inline.rb', line 60

def has_inline?()
    false
end

#has_string?Boolean

Has this RawInline a string value?

Returns:

  • (Boolean)

    true



53
54
55
# File 'lib/paru/filter/raw_inline.rb', line 53

def has_string?()
    true
end