class ActiveFedora::Container

This is the base class for ldp containers, it is not an ldp:BasicContainer

Public Class Methods

find_or_initialize(id) click to toggle source
# File lib/active_fedora/containers/container.rb, line 22
def self.find_or_initialize(id)
  find(id)
rescue ActiveFedora::ObjectNotFoundError
  new(id: id)
end

Public Instance Methods

mint_id() click to toggle source
# File lib/active_fedora/containers/container.rb, line 18
def mint_id
  "#{id}/#{SecureRandom.uuid}"
end
parent() click to toggle source
# File lib/active_fedora/containers/container.rb, line 9
def parent
  @parent || raise("Parent hasn't been set on #{self.class}")
end
parent=(parent) click to toggle source
# File lib/active_fedora/containers/container.rb, line 13
def parent=(parent)
  @parent = parent
  self.membership_resource = [::RDF::URI(parent.uri)]
end

Private Instance Methods

contained=(*_args) click to toggle source

Don’t allow directly setting contained

# File lib/active_fedora/containers/container.rb, line 31
def contained=(*_args); end