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