class Paru::PandocFilter::Code

A Code node, with an attribute object and the code itself as a string.

@!attribute attr

@return [Attr]

@!attribute string

@return [String]

Attributes

attr[RW]
string[RW]

Public Class Methods

new(contents) click to toggle source

Create a new Code node

@param contents [Array] an array of the attribute and the code

# File lib/paru/filter/code.rb, line 38
def initialize(contents)
    @attr = Attr.new contents[0]
    @string = contents[1]
end

Public Instance Methods

ast_contents() click to toggle source

Create an AST representation of this Code node.

# File lib/paru/filter/code.rb, line 44
def ast_contents()
    [
        @attr.to_ast,
        @string
    ]
end
has_inline?() click to toggle source

Has this code node inline contents?

@return [Boolean] false

# File lib/paru/filter/code.rb, line 61
def has_inline?()
    false
end
has_string?() click to toggle source

Has this Code node a string contents?

@return [Boolean] true

# File lib/paru/filter/code.rb, line 54
def has_string?()
    true
end
markdown() click to toggle source

Get the markdown representation of this Node, including the Node itself.

@return [String] the outer markdown representation of this Node

Calls superclass method
# File lib/paru/filter/code.rb, line 69
def markdown()
    super.strip
end