Class: TinymceSpellcheck::TinymceSpellcheck

Inherits:
Object
  • Object
show all
Defined in:
lib/tinymce_spellcheck/tinymce_spellcheck.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}, engine = nil) ⇒ TinymceSpellcheck

Returns a new instance of TinymceSpellcheck.

Raises:

  • (Exception)


3
4
5
6
7
8
9
10
11
12
# File 'lib/tinymce_spellcheck/tinymce_spellcheck.rb', line 3

def initialize(options = {}, 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(options)
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