Class: Omnibar::Popular

Inherits:
Query
  • Object
show all
Defined in:
lib/omnibar/popular.rb

Instance Attribute Summary

Attributes inherited from Query

#input

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

Instance Method Details

#perform!Object



11
12
13
14
# File 'lib/omnibar/popular.rb', line 11

def perform!
  return if input.match?(/^fac?e?b?o?o?k?/)
  open_in_browser "https://#{result}"
end

#resultObject



3
4
5
# File 'lib/omnibar/popular.rb', line 3

def result
  search.find(input)
end

#searchObject



7
8
9
# File 'lib/omnibar/popular.rb', line 7

def search
  @fm ||= FuzzyMatch.new(Omnibar.config.popular.sites)
end