Class: Blacklight::Solr::Response::Group

Inherits:
Object
  • Object
show all
Includes:
PaginationMethods
Defined in:
lib/blacklight/solr/response/group.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from PaginationMethods

#limit_value, #offset_value, #total_count

Constructor Details

#initialize(key, group, response) ⇒ Group

Returns a new instance of Group.



7
8
9
10
11
# File 'lib/blacklight/solr/response/group.rb', line 7

def initialize key, group, response
  @key = key
  @group = group
  @response = response
end

Instance Attribute Details

#groupObject (readonly)

Returns the value of attribute group.



5
6
7
# File 'lib/blacklight/solr/response/group.rb', line 5

def group
  @group
end

#keyObject (readonly)

Returns the value of attribute key.



5
6
7
# File 'lib/blacklight/solr/response/group.rb', line 5

def key
  @key
end

#responseObject (readonly)

Returns the value of attribute response.



5
6
7
# File 'lib/blacklight/solr/response/group.rb', line 5

def response
  @response
end

Instance Method Details

#doclistObject



13
14
15
# File 'lib/blacklight/solr/response/group.rb', line 13

def doclist
  group[:doclist]
end

#docsObject



26
27
28
# File 'lib/blacklight/solr/response/group.rb', line 26

def docs
  doclist[:docs].map {|doc| SolrDocument.new(doc, response)}
end

#fieldObject



30
31
32
# File 'lib/blacklight/solr/response/group.rb', line 30

def field
  response.group_field
end

#startObject



22
23
24
# File 'lib/blacklight/solr/response/group.rb', line 22

def start
  doclist[:start].to_s.to_i
end

#totalObject

short cut to response



18
19
20
# File 'lib/blacklight/solr/response/group.rb', line 18

def total
  doclist[:numFound].to_s.to_i
end