Class: RDF::Node
- Inherits:
-
Object
- Object
- RDF::Node
- Defined in:
- lib/rdf/ext/uri.rb
Instance Method Summary collapse
-
#as(klass, *args) {|self| ... } ⇒ Klass
Create a projection of this Node as the given Spira::Resource class.
Instance Method Details
#as(klass, *args) {|self| ... } ⇒ Klass
Create a projection of this Node as the given Spira::Resource class. Equivalent to klass.for(self, *args)
32 33 34 35 |
# File 'lib/rdf/ext/uri.rb', line 32 def as(klass, *args) raise ArgumentError, "#{klass} is not a Spira resource" unless klass.is_a?(Class) && klass.ancestors.include?(Spira::Base) klass.for(self, *args) end |