Class: TinymceSpellcheck::TinymceSpellcheck
- Inherits:
-
Object
- Object
- TinymceSpellcheck::TinymceSpellcheck
- Defined in:
- lib/tinymce_spellcheck/tinymce_spellcheck.rb
Instance Method Summary collapse
- #check_words(lang, words) ⇒ Object
- #get_suggestions(lang, word) ⇒ Object
-
#initialize(options = {}, engine = nil) ⇒ TinymceSpellcheck
constructor
A new instance of TinymceSpellcheck.
Constructor Details
#initialize(options = {}, engine = nil) ⇒ TinymceSpellcheck
Returns a new instance of TinymceSpellcheck.
3 4 5 6 7 8 9 10 11 12 |
# File 'lib/tinymce_spellcheck/tinymce_spellcheck.rb', line 3 def initialize( = {}, engine = nil) @@engines = [ :raspell ] unless engine engine = :raspell end raise Exception, "Unsupported engine" unless (engine && @@engines.include?(engine)) @engine = Engines.const_get(engine.to_s.classify).new() end |
Instance Method Details
#check_words(lang, words) ⇒ Object
14 15 16 |
# File 'lib/tinymce_spellcheck/tinymce_spellcheck.rb', line 14 def check_words(lang, words) @engine.check_words(lang, words) end |
#get_suggestions(lang, word) ⇒ Object
18 19 20 |
# File 'lib/tinymce_spellcheck/tinymce_spellcheck.rb', line 18 def get_suggestions(lang, word) @engine.get_suggestions(lang, word) end |