Sha256: 89da779fe9c8c32b90d276d79f3222cb9d5b27c940fd9afdf0ddfb1e64523183

Contents?: true

Size: 1.18 KB

Versions: 10

Compression:

Stored size: 1.18 KB

Contents

module ActiveFedora
  class LdpResource < Ldp::Resource::RdfSource
    def build_empty_graph
      graph_class.new(subject_uri)
    end

    def self.graph_class
      ActiveTriples::Resource
    end

    def graph_class
      self.class.graph_class
    end

    ##
    # @param [RDF::Graph] original_graph The graph returned by the LDP server
    # @return [RDF::Graph] A graph striped of any inlined resources present in the original
    def build_graph(original_graph)
      Deprecation.warn(ActiveFedora::LdpResource, '#build_graph is deprecated and will be removed in active-fedora 10.0')
      inlined_resources = get.graph.query(predicate: Ldp.contains).map(&:object)

      # ActiveFedora always wants to copy the resources to a new graph because it
      # forces a cast to FedoraRdfResource
      graph_without_inlined_resources(original_graph, inlined_resources)
    end

    # Don't dump @client, it has a proc and thus can't be serialized.
    def marshal_dump
      (instance_variables - [:@client]).map { |name| [name, instance_variable_get(name)] }
    end

    def marshal_load(data)
      ivars = data
      ivars.each { |name, val| instance_variable_set(name, val) }
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
active-fedora-9.13.0 lib/active_fedora/ldp_resource.rb
active-fedora-9.12.0 lib/active_fedora/ldp_resource.rb
active-fedora-9.11.0 lib/active_fedora/ldp_resource.rb
active-fedora-9.10.4 lib/active_fedora/ldp_resource.rb
active-fedora-9.10.3 lib/active_fedora/ldp_resource.rb
active-fedora-9.10.2 lib/active_fedora/ldp_resource.rb
active-fedora-9.10.1 lib/active_fedora/ldp_resource.rb
active-fedora-9.10.0 lib/active_fedora/ldp_resource.rb
active-fedora-9.10.0.pre2 lib/active_fedora/ldp_resource.rb
active-fedora-9.10.0.pre1 lib/active_fedora/ldp_resource.rb