Class: Omnibar::Google

Inherits:
Query
  • Object
show all
Defined in:
lib/omnibar/queries/google.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, #relevance, #result, #run_silently, #search

Constructor Details

This class inherits a constructor from Omnibar::Query

Instance Method Details

#labelObject



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/omnibar/queries/google.rb', line 3

def label
  [
    ANSI.color('G', res: false, fg: :blue),
    ANSI.color('o', res: false, fg: :red),
    ANSI.color('o', res: false, fg: :yellow),
    ANSI.color('g', res: false, fg: :blue),
    ANSI.color('l', res: false, fg: :green),
    ANSI.color('e', res: false, fg: :red),
    ANSI.reset
  ].join
end

#perform!Object



15
16
17
18
# File 'lib/omnibar/queries/google.rb', line 15

def perform!
  param = input.gsub(/\s/, '+')
  open_in_browser "https://www.google.com/search?q=#{param}"
end