Module: Tripod::Resource::ClassMethods
- Defined in:
- lib/tripod/resource.rb
Instance Method Summary collapse
-
#===(other) ⇒ Object
Performs class equality checking.
- #get_graph_uri ⇒ Object
- #get_rdf_type ⇒ Object
- #graph_uri(new_graph_uri) ⇒ Object
-
#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.
Instance Method Details
#===(other) ⇒ Object
Performs class equality checking.
95 96 97 |
# File 'lib/tripod/resource.rb', line 95 def ===(other) other.class == Class ? self <= other : other.is_a?(self) end |
#get_graph_uri ⇒ Object
114 115 116 |
# File 'lib/tripod/resource.rb', line 114 def get_graph_uri self._GRAPH_URI end |
#get_rdf_type ⇒ Object
106 107 108 |
# File 'lib/tripod/resource.rb', line 106 def get_rdf_type self._RDF_TYPE end |
#graph_uri(new_graph_uri) ⇒ Object
110 111 112 |
# File 'lib/tripod/resource.rb', line 110 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.
101 102 103 104 |
# File 'lib/tripod/resource.rb', line 101 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 |