Sha256: 337c32521dde6e96e8ff91fa9e4a6ac5508f615a5e771dc2ddb14900d986435c

Contents?: true

Size: 782 Bytes

Versions: 15

Compression:

Stored size: 782 Bytes

Contents

# frozen_string_literal: true

module Hyrax
  ##
  # The Valkyrie model for embargoes.
  #
  # @note Embargo and Lease can, in principle, be collapsed into a single model
  #   with a `#visibility_during`, `#visibility_after`, `#end_date`, and
  #   `#history`. We haven't made this transition in order to simplify legacy
  #   support for `Hydra::AccessControls`.
  class Embargo < Valkyrie::Resource
    attribute :visibility_after_embargo,  Valkyrie::Types::String
    attribute :visibility_during_embargo, Valkyrie::Types::String
    attribute :embargo_release_date,      Valkyrie::Types::DateTime
    attribute :embargo_history,           Valkyrie::Types::Array

    def active?
      (embargo_release_date.present? && Time.zone.today < embargo_release_date)
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
hyrax-3.4.2 app/models/hyrax/embargo.rb
hyrax-4.0.0.beta1 app/models/hyrax/embargo.rb
hyrax-3.4.1 app/models/hyrax/embargo.rb
hyrax-3.4.0 app/models/hyrax/embargo.rb
hyrax-3.3.0 app/models/hyrax/embargo.rb
hyrax-3.2.0 app/models/hyrax/embargo.rb
hyrax-3.1.0 app/models/hyrax/embargo.rb
hyrax-3.0.2 app/models/hyrax/embargo.rb
hyrax-3.0.1 app/models/hyrax/embargo.rb
hyrax-3.0.0 app/models/hyrax/embargo.rb
hyrax-3.0.0.pre.rc4 app/models/hyrax/embargo.rb
hyrax-3.0.0.pre.rc3 app/models/hyrax/embargo.rb
hyrax-3.0.0.pre.rc2 app/models/hyrax/embargo.rb
hyrax-3.0.0.pre.rc1 app/models/hyrax/embargo.rb
hyrax-3.0.0.pre.beta3 app/models/hyrax/embargo.rb