Class: Mentor::DidYouMeanCorrection

Inherits:
Object
  • Object
show all
Includes:
Outputs
Defined in:
lib/sections/did_you_mean_correction.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

Constructor Details

#initializeDidYouMeanCorrection

Returns a new instance of DidYouMeanCorrection.



9
10
11
# File 'lib/sections/did_you_mean_correction.rb', line 9

def initialize
  @line = "#{did_you_mean_text}  #{did_you_mean_word}"
end

Instance Attribute Details

#lineObject (readonly)

Returns the value of attribute line.



7
8
9
# File 'lib/sections/did_you_mean_correction.rb', line 7

def line
  @line
end

Class Method Details

.can_handle?Boolean

Returns:

  • (Boolean)


13
14
15
16
# File 'lib/sections/did_you_mean_correction.rb', line 13

def self.can_handle?
  Mentor.tp.raised_exception.respond_to?(:corrections) &&
    Mentor.tp.raised_exception.corrections.any?
end