Class: RSolr::Ext::Response::Base
- Defined in:
- lib/rsolr-ext/response.rb
Instance Attribute Summary collapse
-
#original_hash ⇒ Object
readonly
Returns the value of attribute original_hash.
-
#request_params ⇒ Object
readonly
Returns the value of attribute request_params.
-
#request_path ⇒ Object
readonly
Returns the value of attribute request_path.
Instance Method Summary collapse
- #header ⇒ Object
-
#initialize(hash, handler, request_params) ⇒ Base
constructor
A new instance of Base.
- #method_missing(*args, &blk) ⇒ Object
- #ok? ⇒ Boolean
- #params ⇒ Object
- #rows ⇒ Object
Methods inherited from Mash
#[]=, #default, #delete, #dup, #fetch, #key?, #merge, #regular_update, #regular_writer, #stringify_keys!, #to_hash, #update, #values_at
Methods inherited from Hash
Constructor Details
#initialize(hash, handler, request_params) ⇒ Base
Returns a new instance of Base.
12 13 14 15 16 17 18 19 20 |
# File 'lib/rsolr-ext/response.rb', line 12 def initialize hash, handler, request_params super hash @original_hash = hash @request_path, @request_params = request_path, request_params extend Response extend Docs extend Facets extend Spelling end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(*args, &blk) ⇒ Object
38 39 40 |
# File 'lib/rsolr-ext/response.rb', line 38 def method_missing *args, &blk self.original_hash.send *args, &blk end |
Instance Attribute Details
#original_hash ⇒ Object (readonly)
Returns the value of attribute original_hash.
9 10 11 |
# File 'lib/rsolr-ext/response.rb', line 9 def original_hash @original_hash end |
#request_params ⇒ Object (readonly)
Returns the value of attribute request_params.
10 11 12 |
# File 'lib/rsolr-ext/response.rb', line 10 def request_params @request_params end |
#request_path ⇒ Object (readonly)
Returns the value of attribute request_path.
10 11 12 |
# File 'lib/rsolr-ext/response.rb', line 10 def request_path @request_path end |
Instance Method Details
#header ⇒ Object
22 23 24 |
# File 'lib/rsolr-ext/response.rb', line 22 def header self['responseHeader'] end |
#ok? ⇒ Boolean
34 35 36 |
# File 'lib/rsolr-ext/response.rb', line 34 def ok? (header and header['status']) ? header['status'] == 0 : nil end |
#params ⇒ Object
30 31 32 |
# File 'lib/rsolr-ext/response.rb', line 30 def params (header and header['params']) ? header['params'] : request_params end |
#rows ⇒ Object
26 27 28 |
# File 'lib/rsolr-ext/response.rb', line 26 def rows params[:rows].to_i end |