Module: Tripod::Resource::ClassMethods

Defined in:
lib/tripod/resource.rb

Instance Method Summary collapse

Instance Method Details

#===(other) ⇒ Object

Performs class equality checking.



106
107
108
# File 'lib/tripod/resource.rb', line 106

def ===(other)
  other.class == Class ? self <= other : other.is_a?(self)
end

#get_graph_uriObject



125
126
127
# File 'lib/tripod/resource.rb', line 125

def get_graph_uri
  self._GRAPH_URI
end

#get_rdf_typeObject



117
118
119
# File 'lib/tripod/resource.rb', line 117

def get_rdf_type
  self._RDF_TYPE
end

#graph_uri(new_graph_uri) ⇒ Object



121
122
123
# File 'lib/tripod/resource.rb', line 121

def graph_uri(new_graph_uri)
  self._GRAPH_URI = new_graph_uri
end

#rdf_type(new_rdf_type) ⇒ Object

makes a “field” on this model called rdf_type and sets a class level _RDF_TYPE variable with the rdf_type passed in.



112
113
114
115
# File 'lib/tripod/resource.rb', line 112

def rdf_type(new_rdf_type)
  self._RDF_TYPE = RDF::URI.new(new_rdf_type.to_s)
  field :rdf_type, RDF.type, :multivalued => true, :is_uri => true # things can have more than 1 type and often do
end