Class: Ansr::Blacklight::Solr::Response::Group
- Inherits:
-
Group
- Object
- Group
- Ansr::Blacklight::Solr::Response::Group
- Includes:
- PaginationMethods
- Defined in:
- lib/ansr_blacklight/solr/response/group.rb
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
- #doclist ⇒ Object
- #docs ⇒ Object
- #field ⇒ Object
-
#initialize(group_key, model, group, response) ⇒ Group
constructor
A new instance of Group.
- #start ⇒ Object
-
#total ⇒ Object
short cut to response.
Constructor Details
#initialize(group_key, model, group, response) ⇒ Group
Returns a new instance of Group.
7 8 9 10 |
# File 'lib/ansr_blacklight/solr/response/group.rb', line 7 def initialize group_key, model, group, response super(group_key, model, group) @response = response end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
5 6 7 |
# File 'lib/ansr_blacklight/solr/response/group.rb', line 5 def response @response end |
Instance Method Details
#doclist ⇒ Object
12 13 14 |
# File 'lib/ansr_blacklight/solr/response/group.rb', line 12 def doclist group[:doclist] end |
#docs ⇒ Object
25 26 27 |
# File 'lib/ansr_blacklight/solr/response/group.rb', line 25 def docs doclist[:docs].map {|doc| model.new(doc)} #TODO do we need to have the solrResponse in the item? end |
#field ⇒ Object
29 30 31 |
# File 'lib/ansr_blacklight/solr/response/group.rb', line 29 def field response.group_field end |
#start ⇒ Object
21 22 23 |
# File 'lib/ansr_blacklight/solr/response/group.rb', line 21 def start doclist[:start].to_s.to_i end |
#total ⇒ Object
short cut to response
17 18 19 |
# File 'lib/ansr_blacklight/solr/response/group.rb', line 17 def total doclist[:numFound].to_s.to_i end |