Class: Amigo::URI

Inherits:
Object show all
Includes:
Hamster::Immutable
Defined in:
lib/amigo/uri.rb

Instance Method Summary collapse

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: ==

Returns:

  • (Boolean)


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

#hashObject



36
37
38
# File 'lib/amigo/uri.rb', line 36

def hash
  @uri.hash
end

#to_ntripleObject



25
26
27
# File 'lib/amigo/uri.rb', line 25

def to_ntriple
  "<#{@uri}>"
end

#to_sObject



40
41
42
# File 'lib/amigo/uri.rb', line 40

def to_s
  @uri
end

#to_sparqlObject



21
22
23
# File 'lib/amigo/uri.rb', line 21

def to_sparql
  to_ntriple
end