Class: Misspelling
- Inherits:
-
Object
- Object
- Misspelling
- Defined in:
- lib/aspelllint.rb
Overview
Parse, model, and print a misspelling
Instance Attribute Summary collapse
-
#column ⇒ Object
Returns the value of attribute column.
-
#filename ⇒ Object
Returns the value of attribute filename.
-
#line ⇒ Object
Returns the value of attribute line.
-
#suggestions ⇒ Object
Returns the value of attribute suggestions.
-
#word ⇒ Object
Returns the value of attribute word.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(filename, word, line, column, suggestions) ⇒ Misspelling
constructor
A new instance of Misspelling.
- #to_s ⇒ Object
Constructor Details
#initialize(filename, word, line, column, suggestions) ⇒ Misspelling
Returns a new instance of Misspelling.
69 70 71 72 73 74 75 |
# File 'lib/aspelllint.rb', line 69 def initialize(filename, word, line, column, suggestions) @filename = filename @word = word @line = line @column = column @suggestions = suggestions end |
Instance Attribute Details
#column ⇒ Object
Returns the value of attribute column.
56 57 58 |
# File 'lib/aspelllint.rb', line 56 def column @column end |
#filename ⇒ Object
Returns the value of attribute filename.
56 57 58 |
# File 'lib/aspelllint.rb', line 56 def filename @filename end |
#line ⇒ Object
Returns the value of attribute line.
56 57 58 |
# File 'lib/aspelllint.rb', line 56 def line @line end |
#suggestions ⇒ Object
Returns the value of attribute suggestions.
56 57 58 |
# File 'lib/aspelllint.rb', line 56 def suggestions @suggestions end |
#word ⇒ Object
Returns the value of attribute word.
56 57 58 |
# File 'lib/aspelllint.rb', line 56 def word @word end |
Class Method Details
.parse(filename, aspell_line) ⇒ Object
58 59 60 61 62 63 64 65 66 67 |
# File 'lib/aspelllint.rb', line 58 def self.parse(filename, aspell_line) match = aspell_line.match(/^\&\s(.+)\s([0-9]+)\s([0-9]+)\:\s(.+)$/) w = match[1] l = match[2] c = match[3] s = match[4] Misspelling.new(filename, w, l, c, s) end |
Instance Method Details
#to_s ⇒ Object
77 78 79 |
# File 'lib/aspelllint.rb', line 77 def to_s "#{filename}:#{line}:#{column} #{word}: #{suggestions}" end |