class Glyph::MacroError

A macro error.

Attributes

macro[R]

Public Class Methods

new(message, macro) click to toggle source

Initializes a new Glyph::MacroError @param [String] message the error message @param [Glyph::Macro] macro the macro that caused the error

Calls superclass method
# File lib/glyph.rb, line 57
def initialize(message, macro)
        @macro = macro
        super(message)
end

Public Instance Methods

display() click to toggle source

Displays the error message, source, path and node value (if debugging)

# File lib/glyph.rb, line 63
def display
        warning exception.message
        path = @macro.path.blank? ? "" : "\n   path: #{@macro.path}"
        msg "   source: #{@macro.source_name}#{path}"
        msg "#{"-"*54}\n#{@macro.node.to_s.gsub(/\t/, ' ')}\n#{"-"*54}" if Glyph.debug?
end