class Herb::Errors::UnclosedElementError
def initialize(type, location, message, opening_tag)
def initialize(type, location, message, opening_tag) super(type, location, message) @opening_tag = opening_tag end
def inspect
def inspect tree_inspect.rstrip.gsub(/\s+$/, "") end
def to_hash
def to_hash super.merge({ opening_tag: opening_tag, }) end
def tree_inspect(indent = 0)
def tree_inspect(indent = 0) output = +"" output += %(@ #{error_name} #{location.tree_inspect}\n) output += %(├── message: #{message.inspect}\n) output += %(└── opening_tag: #{opening_tag ? opening_tag.tree_inspect : "∅"}\n) output += %(\n) output.gsub(/^/, " " * indent) end