Class: Sequencescape::Search::MultipleResultHandler
- Inherits:
-
Object
- Object
- Sequencescape::Search::MultipleResultHandler
- Defined in:
- lib/sequencescape/search.rb
Overview
The response from the server contains the JSON for each of the resources found. We simply need to be able to create the resources from each of these.
Instance Method Summary collapse
-
#initialize(api, model) ⇒ MultipleResultHandler
constructor
A new instance of MultipleResultHandler.
- #redirection(json) ⇒ Object
Constructor Details
#initialize(api, model) ⇒ MultipleResultHandler
Returns a new instance of MultipleResultHandler.
43 44 45 46 |
# File 'lib/sequencescape/search.rb', line 43 def initialize(api, model) @api = api @model = model end |
Instance Method Details
#redirection(json) ⇒ Object
48 49 50 51 52 |
# File 'lib/sequencescape/search.rb', line 48 def redirection(json) items = json['searches'].map(&method(:new)) size = json['size'] MultipleResultPaged.new(items, size) end |