Sha256: 5cc1973d28a9fdb0b78bad1fa3ea1b3a8f908d2cce4bc208c768de06a8de3ba4

Contents?: true

Size: 577 Bytes

Versions: 31

Compression:

Stored size: 577 Bytes

Contents

module Krikri::LDP
  class Container < ActiveTriples::Resource
    include Krikri::LDP::Resource 

    configure :type => RDF::URI('http://www.w3.org/ns/ldp#Container')
    
    def initialize(uri, slug)
      @ldp_uri = uri
      @container_slug = slug
      super("#{uri}/#{slug}")
    end

    def save(body = nil, opts = {})
      opts[:Link] = "<#{type.first.to_s}>; rel='type'"
      opts[:Slug] = @container_slug
      opts[:method] = :post unless exists?
      body ||= (dump :ttl)
      opts['Content-Type'] ||= 'text/turtle'
      super(body, opts)
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
krikri-0.13.2 lib/krikri/ldp/container.rb~
krikri-0.13.1 lib/krikri/ldp/container.rb~
krikri-0.13.0 lib/krikri/ldp/container.rb~
krikri-0.12.4 lib/krikri/ldp/container.rb~
krikri-0.11.2 lib/krikri/ldp/container.rb~
krikri-0.11.1 lib/krikri/ldp/container.rb~
krikri-0.11.0 lib/krikri/ldp/container.rb~
krikri-0.10.1 lib/krikri/ldp/container.rb~
krikri-0.8.9 lib/krikri/ldp/container.rb~
krikri-0.8.8 lib/krikri/ldp/container.rb~
krikri-0.8.7 lib/krikri/ldp/container.rb~
krikri-0.8.6 lib/krikri/ldp/container.rb~
krikri-0.8.5 lib/krikri/ldp/container.rb~
krikri-0.8.4 lib/krikri/ldp/container.rb~
krikri-0.8.2 lib/krikri/ldp/container.rb~
krikri-0.8.0 lib/krikri/ldp/container.rb~
krikri-0.7.3 lib/krikri/ldp/container.rb~
krikri-0.7.2 lib/krikri/ldp/container.rb~
krikri-0.7.1 lib/krikri/ldp/container.rb~
krikri-0.6.0 lib/krikri/ldp/container.rb~