Exception: Mentor::NoMethodForNilClassError
- Inherits:
-
MentorNoMethodError
- Object
- StandardError
- MentorError
- MentorNoMethodError
- Mentor::NoMethodForNilClassError
- Defined in:
- lib/errors/no_method_for_nil_class_error.rb
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Colorize
Methods included from OutputHelper
#a_an, #and_sentence, #culprit_line, #home_to_tilde, #indent_lines, #lines_from_file, #or_sentence, #pluralize, #pluralize_words, #terminal_width, #valid_var_name
Methods inherited from MentorError
Class Method Details
.can_handle? ⇒ Boolean
5 6 7 |
# File 'lib/errors/no_method_for_nil_class_error.rb', line 5 def self.can_handle? super && Mentor.tp.raised_exception.to_s['NilClass'] end |
Instance Method Details
#sections ⇒ Object
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/errors/no_method_for_nil_class_error.rb', line 9 def sections [ Header.new, RubyErrorComplete.new, RelativePath.new, LinesOfCode.new, ErrorClassSpecificHelp.new([error_class_specific_help]), Suggestion.new("Try setting #{var_for_method} to a value first and then call the method #{method_name} on it.") ] end |