Class: ErrorToCommunicate::Heuristic::Exception

Inherits:
ErrorToCommunicate::Heuristic show all
Defined in:
lib/error_to_communicate/heuristic/exception.rb

Instance Attribute Summary

Attributes inherited from ErrorToCommunicate::Heuristic

#einfo, #project

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ErrorToCommunicate::Heuristic

#backtrace, #classname, #explanation, #initialize, #message, #semantic_backtrace, #semantic_explanation, #semantic_summary

Constructor Details

This class inherits a constructor from ErrorToCommunicate::Heuristic

Class Method Details

.for?(einfo) ⇒ Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/error_to_communicate/heuristic/exception.rb', line 6

def self.for?(einfo)
  true
end

Instance Method Details

#semantic_infoObject



10
11
12
13
14
15
16
17
18
19
# File 'lib/error_to_communicate/heuristic/exception.rb', line 10

def semantic_info
  [:heuristic,
    [:code, {
      location:  backtrace[0],
      highlight: backtrace[0].label,
      context:   -5..5,
      emphasis:  :code,
    }]
  ]
end