Class: Geoblacklight::Relation::RelationResponse
- Inherits:
-
Object
- Object
- Geoblacklight::Relation::RelationResponse
- Defined in:
- lib/geoblacklight/relation/relation_response.rb
Instance Attribute Summary collapse
-
#search_id ⇒ Object
readonly
Returns the value of attribute search_id.
Instance Method Summary collapse
- #ancestors ⇒ Object
- #descendants ⇒ Object
- #empty? ⇒ Boolean
-
#initialize(id, repository) ⇒ RelationResponse
constructor
A new instance of RelationResponse.
Constructor Details
#initialize(id, repository) ⇒ RelationResponse
Returns a new instance of RelationResponse.
5 6 7 8 |
# File 'lib/geoblacklight/relation/relation_response.rb', line 5 def initialize(id, repository) @search_id = RSolr.solr_escape(id) @repository = repository end |
Instance Attribute Details
#search_id ⇒ Object (readonly)
Returns the value of attribute search_id.
4 5 6 |
# File 'lib/geoblacklight/relation/relation_response.rb', line 4 def search_id @search_id end |
Instance Method Details
#ancestors ⇒ Object
10 11 12 |
# File 'lib/geoblacklight/relation/relation_response.rb', line 10 def ancestors @ancestors ||= Geoblacklight::Relation::Ancestors.new(@search_id, @repository).results end |
#descendants ⇒ Object
14 15 16 |
# File 'lib/geoblacklight/relation/relation_response.rb', line 14 def descendants @descendants ||= Geoblacklight::Relation::Descendants.new(@search_id, @repository).results end |
#empty? ⇒ Boolean
18 19 20 |
# File 'lib/geoblacklight/relation/relation_response.rb', line 18 def empty? !(ancestors['numFound'] > 0 || descendants['numFound'] > 0) end |