Class: Blacklight::Solr::Response::Group
- Inherits:
-
Object
- Object
- Blacklight::Solr::Response::Group
- Includes:
- PaginationMethods
- Defined in:
- lib/blacklight/solr/response/group.rb
Instance Attribute Summary collapse
-
#group ⇒ Object
readonly
Returns the value of attribute group.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
- #doclist ⇒ Object
- #docs ⇒ Object
- #field ⇒ Object
-
#initialize(key, group, response) ⇒ Group
constructor
A new instance of Group.
- #start ⇒ Object
-
#total ⇒ Object
short cut to response.
Methods included from PaginationMethods
#entry_name, #limit_value, #offset_value, #size, #total_count
Constructor Details
#initialize(key, group, response) ⇒ Group
Returns a new instance of Group.
8 9 10 11 12 |
# File 'lib/blacklight/solr/response/group.rb', line 8 def initialize key, group, response @key = key @group = group @response = response end |
Instance Attribute Details
#group ⇒ Object (readonly)
Returns the value of attribute group.
6 7 8 |
# File 'lib/blacklight/solr/response/group.rb', line 6 def group @group end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
6 7 8 |
# File 'lib/blacklight/solr/response/group.rb', line 6 def key @key end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
6 7 8 |
# File 'lib/blacklight/solr/response/group.rb', line 6 def response @response end |
Instance Method Details
#doclist ⇒ Object
14 15 16 |
# File 'lib/blacklight/solr/response/group.rb', line 14 def doclist group[:doclist] end |
#docs ⇒ Object
27 28 29 |
# File 'lib/blacklight/solr/response/group.rb', line 27 def docs doclist[:docs].map { |doc| SolrDocument.new(doc, response) } end |
#field ⇒ Object
31 32 33 |
# File 'lib/blacklight/solr/response/group.rb', line 31 def field response.group_field end |
#start ⇒ Object
23 24 25 |
# File 'lib/blacklight/solr/response/group.rb', line 23 def start doclist[:start].to_s.to_i end |
#total ⇒ Object
short cut to response
19 20 21 |
# File 'lib/blacklight/solr/response/group.rb', line 19 def total doclist[:numFound].to_s.to_i end |