Sha256: 7757b9b5728ad747153f146ba686fb8318916f023149f3841d0a582e3f7623f4

Contents?: true

Size: 664 Bytes

Versions: 12

Compression:

Stored size: 664 Bytes

Contents

# frozen_string_literal: true
module Geoblacklight
  module Relation
    class RelationResponse
      attr_reader :search_id, :link_id
      def initialize(id, repository)
        @link_id = id
        @search_id = RSolr.solr_escape(id)
        @repository = repository
      end

      def ancestors
        @ancestors ||= Geoblacklight::Relation::Ancestors.new(@search_id, @repository).results
      end

      def descendants
        @descendants ||= Geoblacklight::Relation::Descendants.new(@search_id, @repository).results
      end

      def empty?
        !(ancestors['numFound'].positive? || descendants['numFound'].positive?)
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
geoblacklight-3.8.1 lib/geoblacklight/relation/relation_response.rb
geoblacklight-3.8.0 lib/geoblacklight/relation/relation_response.rb
geoblacklight-3.7.0 lib/geoblacklight/relation/relation_response.rb
geoblacklight-3.6.0 lib/geoblacklight/relation/relation_response.rb
geoblacklight-3.5.0 lib/geoblacklight/relation/relation_response.rb
geoblacklight-3.4.0 lib/geoblacklight/relation/relation_response.rb
geoblacklight-3.3.1 lib/geoblacklight/relation/relation_response.rb
geoblacklight-3.3.0 lib/geoblacklight/relation/relation_response.rb
geoblacklight-3.2.0 lib/geoblacklight/relation/relation_response.rb
geoblacklight-3.1.0 lib/geoblacklight/relation/relation_response.rb
geoblacklight-3.0.1 lib/geoblacklight/relation/relation_response.rb
geoblacklight-3.0.0 lib/geoblacklight/relation/relation_response.rb