Class: Omnibar::Snippet
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
.search ⇒ Object
13
14
15
|
# File 'lib/omnibar/snippet.rb', line 13
def self.search
@fz ||= FuzzyMatch.new(Omnibar.config.snippets.keys)
end
|
Instance Method Details
21
22
23
24
|
# File 'lib/omnibar/snippet.rb', line 21
def perform!
key = search.find(input)
copy_to_clipboard snippets[key]
end
|
#result ⇒ Object
3
4
5
6
7
|
# File 'lib/omnibar/snippet.rb', line 3
def result
key = search.find(input)
value = snippets[key]
"#{key} :: #{value}" if (key and value)
end
|
#search ⇒ Object
17
18
19
|
# File 'lib/omnibar/snippet.rb', line 17
def search
self.class.search
end
|
#snippets ⇒ Object
9
10
11
|
# File 'lib/omnibar/snippet.rb', line 9
def snippets
Omnibar.config.snippets
end
|