Class: Dbla::AbstractResponse

Inherits:
HashWithIndifferentAccess
  • Object
show all
Includes:
Blacklight::SolrResponse::PaginationMethods
Defined in:
lib/dbla/abstract_response.rb

Direct Known Subclasses

Response

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#blacklight_configObject

secret api



7
8
9
# File 'lib/dbla/abstract_response.rb', line 7

def blacklight_config
  @blacklight_config
end

#document_modelObject

secret api



7
8
9
# File 'lib/dbla/abstract_response.rb', line 7

def document_model
  @document_model
end

#documentsObject

secret api



7
8
9
# File 'lib/dbla/abstract_response.rb', line 7

def documents
  @documents
end

#limitObject Also known as: rows

secret api



7
8
9
# File 'lib/dbla/abstract_response.rb', line 7

def limit
  @limit
end

#request_paramsObject

secret api



7
8
9
# File 'lib/dbla/abstract_response.rb', line 7

def request_params
  @request_params
end

#startObject

secret api



7
8
9
# File 'lib/dbla/abstract_response.rb', line 7

def start
  @start
end

#totalObject

secret api



7
8
9
# File 'lib/dbla/abstract_response.rb', line 7

def total
  @total
end

Instance Method Details

#aggregationsObject

Facets are built from this method’s output



26
27
28
# File 'lib/dbla/abstract_response.rb', line 26

def aggregations
  {}
end

#export_formatsObject

secret api



30
31
32
# File 'lib/dbla/abstract_response.rb', line 30

def export_formats
  {}
end

#grouped?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/dbla/abstract_response.rb', line 34

def grouped?
  false
end

#headerObject



9
10
11
# File 'lib/dbla/abstract_response.rb', line 9

def header
  self['responseHeader'] || {}
end

#more_like(doc) ⇒ Object



38
39
40
# File 'lib/dbla/abstract_response.rb', line 38

def more_like(doc)
  []
end

#paramsObject



13
14
15
# File 'lib/dbla/abstract_response.rb', line 13

def params
  header['params'] || request_params
end

#sortObject



19
20
21
22
23
# File 'lib/dbla/abstract_response.rb', line 19

def sort
  # REVIEW: There are mixed style key accesses (strings and symbols);
  # Could/Should this be "normalized"?
  params[:sort]
end