Class: RDF::UriNode
- Inherits:
-
Object
- Object
- RDF::UriNode
- Defined in:
- lib/rdf/uri_node.rb
Overview
A uri node.
Instance Attribute Summary collapse
-
#uri ⇒ Object
readonly
the uri of this node.
Instance Method Summary collapse
-
#==(o) ⇒ Object
(also: #eql?)
Returns true if
o
is a UriNode that has the sameuri
. -
#hash ⇒ Object
Returns a hash value for this UriNode.
-
#initialize(uri) ⇒ UriNode
constructor
Creates a new UriNode using
uri
. -
#to_s ⇒ Object
Returns the NTriples representation of this UriNode.
Constructor Details
Instance Attribute Details
#uri ⇒ Object (readonly)
the uri of this node
5 6 7 |
# File 'lib/rdf/uri_node.rb', line 5 def uri @uri end |
Instance Method Details
#==(o) ⇒ Object Also known as: eql?
Returns true if o
is a UriNode that has the same uri
.
17 18 19 20 21 |
# File 'lib/rdf/uri_node.rb', line 17 def ==(o) if RDF::UriNode?(o) uri == o.uri end end |
#hash ⇒ Object
Returns a hash value for this UriNode.
26 27 28 |
# File 'lib/rdf/uri_node.rb', line 26 def hash [-223574050, uri.hash].hash end |
#to_s ⇒ Object
Returns the NTriples representation of this UriNode.
31 32 33 |
# File 'lib/rdf/uri_node.rb', line 31 def to_s Format::NTriples.export_node(self) end |