Class: Dbla::Response
- Inherits:
-
AbstractResponse
- Object
- HashWithIndifferentAccess
- AbstractResponse
- Dbla::Response
- Defined in:
- lib/dbla/response.rb
Instance Attribute Summary
Attributes inherited from AbstractResponse
#blacklight_config, #document_model, #documents, #limit, #request_params, #start, #total
Instance Method Summary collapse
-
#initialize(data, request_params, options = {}) ⇒ Response
constructor
A new instance of Response.
Methods inherited from AbstractResponse
#aggregations, #grouped?, #header, #more_like, #params, #rows, #sort
Constructor Details
#initialize(data, request_params, options = {}) ⇒ Response
Returns a new instance of Response.
4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/dbla/response.rb', line 4 def initialize(data, request_params, = {}) super(force_to_utf8(data)) @request_params = request_params self.document_model = [:solr_document_model] || [:document_model] || Item self.blacklight_config = [:blacklight_config] if data @total = data['count'] @documents = (data['docs'] || []).map {|d| document_model.new(d,self)} @start = data['start'] @limit = data['limit'] end end |