Class: ErrorToCommunicate::Heuristic::NoMethodError
Instance Attribute Summary
#einfo, #project
Class Method Summary
collapse
Instance Method Summary
collapse
#backtrace, #classname, #explanation, #initialize, #message, #semantic_backtrace, #semantic_explanation, #semantic_summary
Class Method Details
.for?(einfo) ⇒ Boolean
6
7
8
9
10
|
# File 'lib/error_to_communicate/heuristic/no_method_error.rb', line 6
def self.for?(einfo)
( einfo.classname == 'NoMethodError' ||
einfo.classname == 'NameError'
) && parse_undefined_name(einfo.message)
end
|
Instance Method Details
#semantic_info ⇒ Object
16
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/error_to_communicate/heuristic/no_method_error.rb', line 16
def semantic_info
[:heuristic,
[:code, {
location: backtrace[0],
highlight: backtrace[0].label,
context: -5..5,
message: "#{undefined_method_name} is undefined",
emphasis: :code,
}]
]
end
|
#undefined_method_name ⇒ Object
12
13
14
|
# File 'lib/error_to_communicate/heuristic/no_method_error.rb', line 12
def undefined_method_name
self.class.parse_undefined_name message
end
|