Class: Rawscsi::SearchHelpers::ResultsHash
- Inherits:
-
Object
- Object
- Rawscsi::SearchHelpers::ResultsHash
- Defined in:
- lib/rawscsi/search_helpers/results_hash.rb
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(response) ⇒ ResultsHash
constructor
A new instance of ResultsHash.
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
#response ⇒ Object (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
#build ⇒ Object
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 |