Class: Geoblacklight::Relation::RelationResponse
- Inherits:
-
Object
- Object
- Geoblacklight::Relation::RelationResponse
- Defined in:
- lib/geoblacklight/relation/relation_response.rb
Instance Attribute Summary collapse
-
#link_id ⇒ Object
readonly
Returns the value of attribute link_id.
-
#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 9 |
# File 'lib/geoblacklight/relation/relation_response.rb', line 5 def initialize(id, repository) @link_id = id @search_id = RSolr.solr_escape(id) @repository = repository end |
Instance Attribute Details
#link_id ⇒ Object (readonly)
Returns the value of attribute link_id.
4 5 6 |
# File 'lib/geoblacklight/relation/relation_response.rb', line 4 def link_id @link_id end |
#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
11 12 13 |
# File 'lib/geoblacklight/relation/relation_response.rb', line 11 def ancestors @ancestors ||= Geoblacklight::Relation::Ancestors.new(@search_id, @repository).results end |
#descendants ⇒ Object
15 16 17 |
# File 'lib/geoblacklight/relation/relation_response.rb', line 15 def descendants @descendants ||= Geoblacklight::Relation::Descendants.new(@search_id, @repository).results end |
#empty? ⇒ Boolean
19 20 21 |
# File 'lib/geoblacklight/relation/relation_response.rb', line 19 def empty? !(ancestors['numFound'] > 0 || descendants['numFound'] > 0) end |