Class: Amigo::URI
- Includes:
- Hamster::Immutable
- Defined in:
- lib/amigo/uri.rb
Instance Method Summary collapse
- #eql?(other) ⇒ Boolean (also: #==)
- #hash ⇒ Object
-
#initialize(uri) ⇒ URI
constructor
A new instance of URI.
- #to_ntriple ⇒ Object
- #to_s ⇒ Object
- #to_sparql ⇒ Object
Constructor Details
#initialize(uri) ⇒ URI
Returns a new instance of URI.
17 18 19 |
# File 'lib/amigo/uri.rb', line 17 def initialize(uri) @uri = uri end |
Instance Method Details
#eql?(other) ⇒ Boolean Also known as: ==
29 30 31 32 33 |
# File 'lib/amigo/uri.rb', line 29 def eql?(other) return true if other.equal?(self) other.class.equal?(self.class) && @uri.eql?(other.instance_variable_get(:@uri)) end |
#hash ⇒ Object
36 37 38 |
# File 'lib/amigo/uri.rb', line 36 def hash @uri.hash end |
#to_ntriple ⇒ Object
25 26 27 |
# File 'lib/amigo/uri.rb', line 25 def to_ntriple "<#{@uri}>" end |
#to_s ⇒ Object
40 41 42 |
# File 'lib/amigo/uri.rb', line 40 def to_s @uri end |
#to_sparql ⇒ Object
21 22 23 |
# File 'lib/amigo/uri.rb', line 21 def to_sparql to_ntriple end |