Class: Omnibar::Spell
Instance Attribute Summary
Attributes inherited from Query
#input
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Query
#copy_to_clipboard, inherited, #initialize, #open_in_browser, #preview_text
Constructor Details
This class inherits a constructor from Omnibar::Query
Class Method Details
.speller ⇒ Object
9
10
11
|
# File 'lib/omnibar/spell.rb', line 9
def self.speller
@sp ||= FFI::Aspell::Speller.new('en_US')
end
|
Instance Method Details
17
18
19
|
# File 'lib/omnibar/spell.rb', line 17
def perform!
copy_to_clipboard result
end
|
#result ⇒ Object
5
6
7
|
# File 'lib/omnibar/spell.rb', line 5
def result
speller.suggestions(input.split(' ').last).first if input.match?(/^spe?l?l? \w+/)
end
|
#speller ⇒ Object
13
14
15
|
# File 'lib/omnibar/spell.rb', line 13
def speller
self.class.speller
end
|