Sha256: fd597d8497cbd7975784cce5fb3a0adcbe4d20679c2337865a2805221d7bbaf0

Contents?: true

Size: 567 Bytes

Versions: 20

Compression:

Stored size: 567 Bytes

Contents

module ActiveFedora
  class LdpResourceService
    attr_reader :connection

    def initialize(conn)
      @connection = conn
    end

    def build(klass, id)
      if id
        LdpResource.new(connection, to_uri(klass, id))
      else
        LdpResource.new(connection, nil, nil, ActiveFedora.fedora.host + ActiveFedora.fedora.base_path)
      end
    end

    def update(change_set, klass, id)
      SparqlInsert.new(change_set.changes).execute(to_uri(klass, id))
    end

    private

      def to_uri(klass, id)
        klass.id_to_uri(id)
      end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
active-fedora-9.7.3 lib/active_fedora/ldp_resource_service.rb
active-fedora-9.7.2 lib/active_fedora/ldp_resource_service.rb
active-fedora-9.12.0 lib/active_fedora/ldp_resource_service.rb
active-fedora-9.11.0 lib/active_fedora/ldp_resource_service.rb
active-fedora-9.10.4 lib/active_fedora/ldp_resource_service.rb
active-fedora-9.10.3 lib/active_fedora/ldp_resource_service.rb
active-fedora-9.10.2 lib/active_fedora/ldp_resource_service.rb
active-fedora-9.10.1 lib/active_fedora/ldp_resource_service.rb
active-fedora-9.10.0 lib/active_fedora/ldp_resource_service.rb
active-fedora-9.10.0.pre2 lib/active_fedora/ldp_resource_service.rb
active-fedora-9.10.0.pre1 lib/active_fedora/ldp_resource_service.rb
active-fedora-9.9.1 lib/active_fedora/ldp_resource_service.rb
active-fedora-9.9.0 lib/active_fedora/ldp_resource_service.rb
active-fedora-9.8.2 lib/active_fedora/ldp_resource_service.rb
active-fedora-9.8.1 lib/active_fedora/ldp_resource_service.rb
active-fedora-9.8.0 lib/active_fedora/ldp_resource_service.rb
active-fedora-9.7.1 lib/active_fedora/ldp_resource_service.rb
active-fedora-9.7.0 lib/active_fedora/ldp_resource_service.rb
active-fedora-9.6.2 lib/active_fedora/ldp_resource_service.rb
active-fedora-9.6.1 lib/active_fedora/ldp_resource_service.rb