Class: Corrector::Base
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Corrector::Base
- Defined in:
- app/models/corrector/base.rb
Overview
Stores a list of translations (words or phrases).
Class Method Summary collapse
-
.scan(value) ⇒ Object
Scans the dictionary for source string translation.
Class Method Details
.scan(value) ⇒ Object
Scans the dictionary for source string translation. Returns the source if no translation found.
Params:
value-
a string to be scanned
Returns a translation or the source itself if no translation found.
32 33 34 |
# File 'app/models/corrector/base.rb', line 32 def self.scan(value) where(from: value).first.try(:to) || value end |