Class: Redlander::Uri Private
- Inherits:
-
Object
- Object
- Redlander::Uri
- Defined in:
- lib/redlander/uri.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Uri (for internal use)
Instance Method Summary collapse
- #eql?(other_uri) ⇒ Boolean (also: #==) private
-
#initialize(source) ⇒ Uri
constructor
private
Create Redlander::Uri.
- #rdf_uri ⇒ Object private
- #to_s ⇒ Object private
Constructor Details
#initialize(source) ⇒ Uri
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Create Redlander::Uri
36 37 38 |
# File 'lib/redlander/uri.rb', line 36 def initialize(source) @source = source.is_a?(FFI::Pointer) ? wrap(source) : source end |
Instance Method Details
#eql?(other_uri) ⇒ Boolean Also known as: ==
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
44 45 46 |
# File 'lib/redlander/uri.rb', line 44 def eql?(other_uri) other_uri.is_a?(Uri) && (Redland.librdf_uri_equals(rdf_uri, other_uri.rdf_uri) != 0) end |
#rdf_uri ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/redlander/uri.rb', line 6 def rdf_uri unless instance_variable_defined?(:@rdf_uri) @rdf_uri = case @source when FFI::Pointer @source when URI, String Redland.librdf_new_uri(Redlander.rdf_world, @source.to_s) else raise NotImplementedError, "Cannot create Uri from '#{@source.inspect}'" end raise RedlandError, "Failed to create Uri from '#{@source.inspect}'" if @rdf_uri.null? ObjectSpace.define_finalizer(self, self.class.send(:finalize_uri, @rdf_uri)) end @rdf_uri end |
#to_s ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
40 41 42 |
# File 'lib/redlander/uri.rb', line 40 def to_s Redland.librdf_uri_to_string(rdf_uri) end |