Module: Fargo::Supports::Searches
Instance Method Summary collapse
- #remove_search(search) ⇒ Object
- #search(search) ⇒ Object
- #search_results(search) ⇒ Object
- #searches ⇒ Object
Instance Method Details
#remove_search(search) ⇒ Object
28 29 30 31 32 |
# File 'lib/fargo/supports/searches.rb', line 28 def remove_search search search = normalize search @searches.delete search.to_s if @searches @search_objects.delete search.to_s if @search_objects end |
#search(search) ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/fargo/supports/searches.rb', line 10 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_results(search) ⇒ Object
23 24 25 26 |
# File 'lib/fargo/supports/searches.rb', line 23 def search_results search search = normalize search @searches[search.to_s] if @searches end |
#searches ⇒ Object
19 20 21 |
# File 'lib/fargo/supports/searches.rb', line 19 def searches @searches.keys.map { |k| @search_objects[k] } if @searches end |