Module: ActiveFedora::RDF::Persistence

Extended by:
ActiveSupport::Concern
Defined in:
lib/active_fedora/rdf/persistence.rb

Overview

Mixin for adding datastream persistence to an ActiveTriples::Resource descendant so that it may be used to back an ActiveFedora::RDFDatastream.

Constant Summary collapse

BASE_URI =
'info:fedora/'

Instance Method Summary collapse

Instance Method Details

#persist!Object

Overrides ActiveTriples::Resource


21
22
23
24
# File 'lib/active_fedora/rdf/persistence.rb', line 21

def persist!
  return false unless datastream and datastream.respond_to? :save
  @persisted ||= datastream.save
end

#persisted?Boolean

Overrides ActiveTriples::Resource

Returns:

  • (Boolean)

27
28
29
# File 'lib/active_fedora/rdf/persistence.rb', line 27

def persisted?
  @persisted ||= (not datastream.new_record?)
end