Module: Fargo::Supports::Searches
Instance Method Summary collapse
- #remove_search(search) ⇒ Object
- #search(search) ⇒ Object
-
#search_files(options) ⇒ Object
see parser#@@search for what’s passed in.
- #search_hub(query) ⇒ Object
- #search_results(search) ⇒ Object
- #searches ⇒ Object
Instance Method Details
#remove_search(search) ⇒ Object
49 50 51 52 53 |
# File 'lib/fargo/supports/searches.rb', line 49 def remove_search search search = normalize search @searches.delete search.to_s @search_objects.delete search.to_s end |
#search(search) ⇒ Object
31 32 33 34 35 36 37 38 |
# File 'lib/fargo/supports/searches.rb', line 31 def search search raise ConnectionException.new 'Not connected yet!' unless connected? search = normalize search @searches[search.to_s] = [] @search_objects[search.to_s] = search search_hub search end |
#search_files(options) ⇒ Object
see parser#@@search for what’s passed in
searches this client’s files based on those options and returns an array of SearchResult(s)
14 15 16 17 |
# File 'lib/fargo/supports/searches.rb', line 14 def search_files # TODO: implement me [] end |
#search_hub(query) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/fargo/supports/searches.rb', line 19 def search_hub query raise ConnectionError.new('Not connected Yet!') unless connected? if config.passive location = "Hub:#{config.nick}" else location = "#{config.address}:#{config.search_port}" end hub. 'Search', "#{location} #{query.to_s}" end |
#search_results(search) ⇒ Object
44 45 46 47 |
# File 'lib/fargo/supports/searches.rb', line 44 def search_results search search = normalize search @searches[search.to_s] end |
#searches ⇒ Object
40 41 42 |
# File 'lib/fargo/supports/searches.rb', line 40 def searches @searches.keys.map { |k| @search_objects[k] } end |