Class: Paru::PandocFilter::Str

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

Overview

A Str node represents a string

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ Str

Create a new Str node based on the value

Parameters:

  • value (String)


34
35
36
# File 'lib/paru/filter/str.rb', line 34

def initialize(value)
    @string = value
end

Instance Attribute Details

#stringString

Returns the value of this Str node.

Returns:

  • (String)

    the value of this Str node.



27
28
29
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
# File 'lib/paru/filter/str.rb', line 27

class Str < Inline

    attr_accessor :string

    # Create a new Str node based on the value
    #
    # @param value [String]
    def initialize(value)
        @string = value
    end

    # The AST contents
    def ast_contents()
        @string
    end

    # Has the Str node a string value? Of course!
    #
    # @return [Boolean] true
    def has_string?()
        true
    end

    # Has the Str node inline contents? 
    #
    # @return [Boolean] false
    def has_inline?()
        false
    end
end

Instance Method Details

#ast_contentsObject

The AST contents



39
40
41
# File 'lib/paru/filter/str.rb', line 39

def ast_contents()
    @string
end

#has_inline?Boolean

Has the Str node inline contents?

Returns:

  • (Boolean)

    false



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

def has_inline?()
    false
end

#has_string?Boolean

Has the Str node a string value? Of course!

Returns:

  • (Boolean)

    true



46
47
48
# File 'lib/paru/filter/str.rb', line 46

def has_string?()
    true
end