Class: Typocop::Cop
- Inherits:
-
Object
- Object
- Typocop::Cop
- Defined in:
- lib/typocop/cop.rb
Instance Attribute Summary collapse
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#typos ⇒ Object
readonly
Returns the value of attribute typos.
Instance Method Summary collapse
- #correct_words ⇒ Object
- #incorrect_words ⇒ Object
-
#initialize(path, line, typos) ⇒ Cop
constructor
A new instance of Cop.
Constructor Details
#initialize(path, line, typos) ⇒ Cop
Returns a new instance of Cop.
5 6 7 8 9 |
# File 'lib/typocop/cop.rb', line 5 def initialize(path, line, typos) @path = path @line = line @typos = typos end |
Instance Attribute Details
#line ⇒ Object (readonly)
Returns the value of attribute line.
3 4 5 |
# File 'lib/typocop/cop.rb', line 3 def line @line end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
3 4 5 |
# File 'lib/typocop/cop.rb', line 3 def path @path end |
#typos ⇒ Object (readonly)
Returns the value of attribute typos.
3 4 5 |
# File 'lib/typocop/cop.rb', line 3 def typos @typos end |
Instance Method Details
#correct_words ⇒ Object
15 16 17 |
# File 'lib/typocop/cop.rb', line 15 def correct_words @typos.map { |typo| typo[:correct_word] } end |
#incorrect_words ⇒ Object
11 12 13 |
# File 'lib/typocop/cop.rb', line 11 def incorrect_words @typos.map { |typo| typo[:incorrect_word] } end |