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, &block) ⇒ Object
Constructor Details
#initialize(api, model) ⇒ MultipleResultHandler
Returns a new instance of MultipleResultHandler.
42 43 44 |
# File 'lib/sequencescape/search.rb', line 42 def initialize(api,model) @api, @model = api, model end |
Instance Method Details
#redirection(json, &block) ⇒ Object
46 47 48 49 50 |
# File 'lib/sequencescape/search.rb', line 46 def redirection(json, &block) items = json['searches'].map(&method(:new)) size = json['size'] MultipleResultPaged.new(items, size) end |