Exception: Laser::DeadCodeWarning

Inherits:
Error show all
Defined in:
lib/laser/analysis/errors.rb

Constant Summary

Constant Summary

Constants inherited from Error

Error::ADVISORY, Error::ERROR, Error::FUCKUP, Error::MAJOR_ERROR, Error::MAJOR_WARNING, Error::MINOR_WARNING, Error::SIMPLE_ERROR, Error::STYLE, Error::TRICKY_ERROR, Error::WARNING

Constants inherited from Exception

Exception::BT_FAILURE_MESSAGE

Instance Attribute Summary

Attributes inherited from Error

#ast_node, #severity

Instance Method Summary collapse

Methods inherited from Error

#==, #inspect, #line_number, severity

Methods inherited from Exception

#backtrace, #set_backtrace, #to_s

Constructor Details

#initialize(message, ast_node) ⇒ DeadCodeWarning

Returns a new instance of DeadCodeWarning



87
88
89
90
91
92
93
# File 'lib/laser/analysis/errors.rb', line 87

def initialize(message, ast_node)
  if ast_node.source_begin
    super("Dead Code #{ast_node.source_begin[0]}:#{ast_node.source_begin[1]}", ast_node)
  else
    super("Dead Code", ast_node)
  end
end