Redland RDF Application Framework - Ruby RDoc - Class: Redland::Uri

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

Class | Redland::Uri
In: | rdf/redland/uri.rb
Parent: | Object

### Methods

== create_finalizer new to_s

### Attributes

uri | [RW] |

### Public Class methods

create_finalizer(uri)

You shouldn‘t use this. Used internally for cleanup.

[Source]

    # 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)

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)

[Source]

    # 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)

Equivalence. Only works with other URI objects

[Source]

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

to_s()

Returns a string for this URI

[Source]

    # 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-2011 Dave Beckett, (C) Copyright 2004-2005 University of Bristol