Class: MdSpell::Typo
- Inherits:
-
Object
- Object
- MdSpell::Typo
- Defined in:
- lib/mdspell/typo.rb
Overview
A wrapper class for single, misspelled word.
Instance Attribute Summary collapse
-
#line ⇒ Object
readonly
A TextLine that contains this error.
-
#suggestions ⇒ Object
readonly
A list of suggestions for this error.
-
#word ⇒ Object
readonly
A misspelled word.
Instance Method Summary collapse
-
#initialize(line, word, suggestions) ⇒ Typo
constructor
Create a new SpellingError.
Constructor Details
#initialize(line, word, suggestions) ⇒ Typo
Create a new SpellingError.
17 18 19 20 21 22 23 24 25 |
# File 'lib/mdspell/typo.rb', line 17 def initialize(line, word, suggestions) assert_proper_line_type(line) assert_proper_word_type(word) assert_proper_suggestions_type(suggestions) @line = line @word = word @suggestions = suggestions end |
Instance Attribute Details
#line ⇒ Object (readonly)
A TextLine that contains this error.
5 6 7 |
# File 'lib/mdspell/typo.rb', line 5 def line @line end |
#suggestions ⇒ Object (readonly)
A list of suggestions for this error.
11 12 13 |
# File 'lib/mdspell/typo.rb', line 11 def suggestions @suggestions end |
#word ⇒ Object (readonly)
A misspelled word.
8 9 10 |
# File 'lib/mdspell/typo.rb', line 8 def word @word end |