Class: Solr::Response::Base
- Inherits:
-
Object
- Object
- Solr::Response::Base
- Defined in:
- lib/solr_ruby_support.rb
Direct Known Subclasses
Class Method Summary collapse
Class Method Details
.make_response(request, raw) ⇒ Object
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/solr_ruby_support.rb', line 48 def self.make_response(request, raw) # make sure response format seems sane unless [:xml, :ruby, :javabin].include?(request.response_format) raise Solr::Exception.new("unknown response format: #{request.response_format}" ) end # TODO: Factor out this case... perhaps the request object should provide the response class instead? Or dynamically align by class name? # Maybe the request itself could have the response handling features that get mixed in with a single general purpose response object? begin klass = eval(request.class.name.sub(/Request/,'Response')) rescue NameError raise Solr::Exception.new("unknown request type: #{request.class}") else klass.new(raw) end end |