Class: Rawscsi::SearchHelpers::ResultsHash

Inherits:
Object
  • Object
show all
Defined in:
lib/rawscsi/search_helpers/results_hash.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ ResultsHash

Returns a new instance of ResultsHash.



6
7
8
# File 'lib/rawscsi/search_helpers/results_hash.rb', line 6

def initialize(response)    
  @response = response
end

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response.



4
5
6
# File 'lib/rawscsi/search_helpers/results_hash.rb', line 4

def response
  @response
end

Instance Method Details

#buildObject



10
11
12
# File 'lib/rawscsi/search_helpers/results_hash.rb', line 10

def build
  @response["hits"]["hit"].map {|h| h["fields"].merge("id" => h["id"])}
end