Sha256: 37f9670daed99d153f0213f507278cc0568dffa0a221e0d5e5dda27c466faf58

Contents?: true

Size: 428 Bytes

Versions: 3

Compression:

Stored size: 428 Bytes

Contents

module PublishMyData
  class Resource

    include Tripod::Resource

    field :label, RDF::RDFS.label

    # Is this resource in the host domain?
    def local?
      uri.starts_with?("http://" + PublishMyData.local_domain)
    end

    class << self

      def uri_from_host_and_doc_path(host, doc_path, format="")
        'http://' + host + '/id/' + doc_path.split('?')[0].sub(/\.#{format}$/,'')
      end
    end
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
publish_my_data-0.0.3 app/models/publish_my_data/resource.rb
publish_my_data-0.0.2 app/models/publish_my_data/resource.rb
publish_my_data-0.0.1 app/models/publish_my_data/resource.rb