Sha256: 9ca974e3cc7260270699323a2c4d8d91f11ec77ab735856bbf27cf06bedefb5c

Contents?: true

Size: 550 Bytes

Versions: 24

Compression:

Stored size: 550 Bytes

Contents

class TimeSpan < ActiveTriples::Resource
  def initialize(uri = RDF::Node.new, _parent = ActiveTriples::Resource.new)
    uri = if uri.try(:node?)
            RDF::URI("#timespan_#{uri.to_s.gsub('_:', '')}")
          elsif uri.to_s.include?('#')
            RDF::URI(uri)
          end
    super
  end

  def persisted?
    !new_record?
  end

  def new_record?
    id.start_with?('#')
  end

  configure type: ::RDF::Vocab::EDM.TimeSpan
  property :start, predicate: ::RDF::Vocab::EDM.begin
  property :finish, predicate: ::RDF::Vocab::EDM.end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
hyrax-5.0.1 .dassie/app/models/time_span.rb
hyrax-5.0.0 .dassie/app/models/time_span.rb
hyrax-5.0.0.rc3 .dassie/app/models/time_span.rb
hyrax-5.0.0.rc2 .dassie/app/models/time_span.rb
hyrax-5.0.0.rc1 .dassie/app/models/time_span.rb
hyrax-3.6.0 .dassie/app/models/time_span.rb
hyrax-4.0.0 .dassie/app/models/time_span.rb
hyrax-4.0.0.rc3 .dassie/app/models/time_span.rb
hyrax-4.0.0.rc2 .dassie/app/models/time_span.rb
hyrax-4.0.0.rc1 .dassie/app/models/time_span.rb
hyrax-3.5.0 .dassie/app/models/time_span.rb
hyrax-4.0.0.beta2 .dassie/app/models/time_span.rb
hyrax-3.4.2 .dassie/app/models/time_span.rb
hyrax-4.0.0.beta1 .dassie/app/models/time_span.rb
hyrax-3.4.1 .dassie/app/models/time_span.rb
hyrax-3.4.0 .dassie/app/models/time_span.rb
hyrax-3.3.0 .dassie/app/models/time_span.rb
hyrax-3.2.0 .dassie/app/models/time_span.rb
hyrax-3.1.0 .dassie/app/models/time_span.rb
hyrax-3.0.2 .dassie/app/models/time_span.rb