Module: RSolrExt::Response::Base
Overview
my_solr_hash.extend RSolrExt::Response::Base my_solr_hash.header my_solr_hash.ok?
Class Method Summary collapse
-
.create(hash) ⇒ Object
converts to mash, then extends.
Instance Method Summary collapse
Class Method Details
.create(hash) ⇒ Object
converts to mash, then extends
29 30 31 32 33 |
# File 'lib/rsolr_ext/response/base.rb', line 29 def self.create(hash) mash = hash.is_a?(Mash) ? hash : hash.to_mash mash.extend self mash end |
Instance Method Details
#header ⇒ Object
8 9 10 |
# File 'lib/rsolr_ext/response/base.rb', line 8 def header self[:responseHeader] end |
#ok? ⇒ Boolean
24 25 26 |
# File 'lib/rsolr_ext/response/base.rb', line 24 def ok? self.status == 0 end |
#params ⇒ Object
12 13 14 |
# File 'lib/rsolr_ext/response/base.rb', line 12 def params header[:params] end |
#query_time ⇒ Object
20 21 22 |
# File 'lib/rsolr_ext/response/base.rb', line 20 def query_time header[:QTime] end |
#status ⇒ Object
16 17 18 |
# File 'lib/rsolr_ext/response/base.rb', line 16 def status header[:status].to_i end |