Class: Hyrax::LeaseService

Inherits:
RestrictionService show all
Defined in:
app/services/hyrax/lease_service.rb

Overview

Methods for Querying Repository to find Objects with leases

Class Method Summary collapse

Methods inherited from RestrictionService

blacklight_config

Class Method Details

.assets_with_deactivated_leasesObject

Returns all assets that have had embargoes deactivated in the past.



26
27
28
29
# File 'app/services/hyrax/lease_service.rb', line 26

def assets_with_deactivated_leases
  builder = Hyrax::DeactivatedLeaseSearchBuilder.new(self)
  presenters(builder)
end

.assets_with_enforced_leasesObject Also known as: assets_under_lease

Returns all assets with leases that are currently enforced, regardless of whether the leases are active or expired.



19
20
21
22
# File 'app/services/hyrax/lease_service.rb', line 19

def assets_with_enforced_leases
  builder = Hyrax::LeaseSearchBuilder.new(self)
  presenters(builder).select(&:enforced?)
end

.assets_with_expired_enforced_leasesObject Also known as: assets_with_expired_leases

Returns all assets with lease expiration date set to a date in the past



8
9
10
11
# File 'app/services/hyrax/lease_service.rb', line 8

def assets_with_expired_enforced_leases
  builder = Hyrax::ExpiredLeaseSearchBuilder.new(self)
  presenters(builder)
end

.search_state_classObject



31
32
33
# File 'app/services/hyrax/lease_service.rb', line 31

def search_state_class
  nil
end