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

#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

#groupObject (readonly)

Returns the value of attribute group.



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

def group
  @group
end

#keyObject (readonly)

Returns the value of attribute key.



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

def key
  @key
end

#responseObject (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

#doclistObject



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

def doclist
  group[:doclist]
end

#docsObject



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

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

#fieldObject



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

def field
  response.group_field
end

#startObject



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

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

#totalObject

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