Class: Q::Search
Instance Attribute Summary
Attributes inherited from Command
Instance Method Summary collapse
- #execute(shortcut, terms) ⇒ Object
-
#initialize(url_pattern, usage) ⇒ Search
constructor
A new instance of Search.
Methods inherited from Command
Constructor Details
#initialize(url_pattern, usage) ⇒ Search
Returns a new instance of Search.
3 4 5 6 |
# File 'lib/q/commands/search.rb', line 3 def initialize(url_pattern, usage) @url_pattern = url_pattern super(usage) end |
Instance Method Details
#execute(shortcut, terms) ⇒ Object
9 10 11 12 13 |
# File 'lib/q/commands/search.rb', line 9 def execute(shortcut, terms) url = @url_pattern % terms.join("+") %x{osascript -e 'open location "#{url}"'} url end |