Module: ActiveRDF::NamespaceProxy
- Defined in:
- lib/active_rdf/objectmanager/namespace.rb
Instance Attribute Summary collapse
-
#klasses ⇒ Object
Returns the value of attribute klasses.
-
#prefix ⇒ Object
Returns the value of attribute prefix.
-
#resources ⇒ Object
Returns the value of attribute resources.
Class Method Summary collapse
Instance Method Summary collapse
-
#const_missing(klass) ⇒ Object
catch FOAF::Person.
-
#method_missing(method, *args) ⇒ Object
catch FOAF::name.
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
Instance Attribute Details
#klasses ⇒ Object
Returns the value of attribute klasses.
108 109 110 |
# File 'lib/active_rdf/objectmanager/namespace.rb', line 108 def klasses @klasses end |
#prefix ⇒ Object
Returns the value of attribute prefix.
108 109 110 |
# File 'lib/active_rdf/objectmanager/namespace.rb', line 108 def prefix @prefix end |
#resources ⇒ Object
Returns the value of attribute resources.
108 109 110 |
# File 'lib/active_rdf/objectmanager/namespace.rb', line 108 def resources @resources end |
Class Method Details
.extend_object(obj) ⇒ Object
110 111 112 113 114 115 116 117 |
# File 'lib/active_rdf/objectmanager/namespace.rb', line 110 def NamespaceProxy.extend_object(obj) # make some builtin methods private because lookup doesn't work otherwise # on e.g. RDF::type and FOAF::name class << obj [:type, :name, :id].each {|m| private(m) if respond_to?(m)} end super end |
Instance Method Details
#const_missing(klass) ⇒ Object
catch FOAF::Person
126 127 128 129 130 |
# File 'lib/active_rdf/objectmanager/namespace.rb', line 126 def const_missing(klass) ActiveRdfLogger::log_info(self) { "Const missing on Namespace #{klass}" } @klasses ||={} # class cache @klasses[klass] ||= ObjectManager.construct_class(Namespace.lookup(@prefix, klass)) end |