Class | Redland::Uri |
In: | rdf/redland/uri.rb |
Parent: | Object |
uri | [RW] |
You shouldn‘t use this. Used internally for cleanup.
# File rdf/redland/uri.rb, line 29 def Uri.create_finalizer(uri) proc {|id| "Finalizer on #{id}" #puts "closing uri" Redland::librdf_free_uri(uri) } end
Initialize a Uri
uri = RDF::Redland::Uri.new('kris') uri2 = RDF::Redland::Uri.new(uri) require 'uri' uri = Uri.parse('http://www.xmlns.com') uri_from_Uri = RDF::Redland::Uri.new(uri)
# File rdf/redland/uri.rb, line 15 def initialize(uri_string) case uri_string when String @uri = Redland.librdf_new_uri($world.world,uri_string) when Uri @uri = Redland.librdf_new_uri_from_uri(uri_string.uri) when SWIG::TYPE_p_librdf_uri_s @uri = Redland.librdf_new_uri_from_uri(uri_string) end if not @uri then raise RedlandError.new("Unable to create Uri") end ObjectSpace.define_finalizer(self,Uri.create_finalizer(@uri)) end
(C) Copyright 2004-2011 Dave Beckett, (C) Copyright 2004-2005 University of Bristol