Class: Clarification::Search

Inherits:
Object
  • Object
show all
Defined in:
lib/clarification/search.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSearch


6
7
8
# File 'lib/clarification/search.rb', line 6

def initialize
  @last_search = nil
end

Instance Attribute Details

#last_searchObject (readonly)

Returns the value of attribute last_search


4
5
6
# File 'lib/clarification/search.rb', line 4

def last_search
  @last_search
end

Instance Method Details

#by_concept(concept) ⇒ Object


20
21
22
23
24
25
26
# File 'lib/clarification/search.rb', line 20

def by_concept(concept)
  search_requester = Clarification::SearchRequester.new
  raw_response = search_requester.get_results_for_concept(concept)
  structured_response = Clarification::SearchResponse.new(raw_response.body, concept)
  @last_search = structured_response
  return structured_response
end

#by_images(_image_array) ⇒ Object


16
17
18
# File 'lib/clarification/search.rb', line 16

def by_images(_image_array)
  raise "Not Implemented"
end

#index_images(image_array) ⇒ Object


10
11
12
13
14
# File 'lib/clarification/search.rb', line 10

def index_images(image_array)
  search_requester = Clarification::SearchRequester.new
  search_requester.index(image_array)  # need some useful response here

end