Parent

Redland::Uri

Attributes

uri[RW]

Public Class Methods

create_finalizer(uri) click to toggle source

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
new(uri_string) click to toggle source

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

Public Instance Methods

==(other) click to toggle source

Equivalence. Only works with other URI objects

# File rdf/redland/uri.rb, line 42
def == (other)
  return (Redland.librdf_uri_equals(self.uri,other.uri) != 0)
end
to_s() click to toggle source

Returns a string for this URI

# File rdf/redland/uri.rb, line 37
def to_s
  return Redland.librdf_uri_to_string(@uri)
end

Go to Redland Home - Language Bindings Home - Ruby API Home

(C) Copyright 2004-2013 Dave Beckett, (C) Copyright 2004-2005 University of Bristol