Module: ActiveRDF::ResourceLike

Defined in:
lib/active_rdf/objectmanager/resource_like.rb

Overview

Helper Module that contains same additional methods that are expected from classes that want to behave like RDFS::Resource.

The module expects that the including class has an uri method or property.

Instance Method Summary collapse

Instance Method Details

#<=>(other) ⇒ Object

overriding sort based on uri



17
18
19
# File 'lib/active_rdf/objectmanager/resource_like.rb', line 17

def <=>(other) 
  uri <=> other.uri
end

#to_literal_sObject

NTriple representation of element



22
23
24
# File 'lib/active_rdf/objectmanager/resource_like.rb', line 22

def to_literal_s
  "<#{uri}>"
end

#to_sObject

returns uri of resource, can be overridden in subclasses



12
13
14
# File 'lib/active_rdf/objectmanager/resource_like.rb', line 12

def to_s
  "<#{uri}>"
end