Class: Clarification::SearchResponse

Inherits:
Response
  • Object
show all
Defined in:
lib/clarification/response/search_response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(raw_response, concept) ⇒ SearchResponse

Returns a new instance of SearchResponse.


7
8
9
10
11
12
13
# File 'lib/clarification/response/search_response.rb', line 7

def initialize(raw_response, concept)
  @hits = []
  @concept = concept
  @raw_response = JSON.parse(raw_response)

  parse_raw_response
end

Instance Attribute Details

#conceptObject (readonly)

Returns the value of attribute concept


5
6
7
# File 'lib/clarification/response/search_response.rb', line 5

def concept
  @concept
end

#hitsObject (readonly)

Returns the value of attribute hits


5
6
7
# File 'lib/clarification/response/search_response.rb', line 5

def hits
  @hits
end

#raw_responseObject (readonly)

Returns the value of attribute raw_response


5
6
7
# File 'lib/clarification/response/search_response.rb', line 5

def raw_response
  @raw_response
end