Class: Omnibar::Query
- Inherits:
-
Object
show all
- Defined in:
- lib/omnibar/query.rb
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(input) ⇒ Query
Returns a new instance of Query.
6
7
8
|
# File 'lib/omnibar/query.rb', line 6
def initialize(input)
@input = input
end
|
Instance Attribute Details
Returns the value of attribute input.
4
5
6
|
# File 'lib/omnibar/query.rb', line 4
def input
@input
end
|
Class Method Details
.inherited(subclass) ⇒ Object
10
11
12
13
|
# File 'lib/omnibar/query.rb', line 10
def self.inherited(subclass)
Omnibar::App.add_query(subclass)
super(subclass)
end
|
Instance Method Details
#copy_to_clipboard(value) ⇒ Object
25
26
27
|
# File 'lib/omnibar/query.rb', line 25
def copy_to_clipboard(value)
`echo "#{value}" | xsel -i --clipboard`
end
|
#open_in_browser(url) ⇒ Object
29
30
31
|
# File 'lib/omnibar/query.rb', line 29
def open_in_browser(url)
Thread.new { `xdg-open "#{url}" >/dev/null 2>&1` }
end
|
#preview_text ⇒ Object
15
16
17
18
19
|
# File 'lib/omnibar/query.rb', line 15
def preview_text
res = result
name = self.class.name.split('::').last
[name, res] unless result.nil? || result.empty?
end
|
#result ⇒ Object
21
22
23
|
# File 'lib/omnibar/query.rb', line 21
def result
input
end
|