Module: RDF::NodeProxy::ClassMethods

Defined in:
lib/lightrdf/node_proxy.rb

Instance Method Summary collapse

Instance Method Details

#inherited(subclass) ⇒ Object



11
12
13
# File 'lib/lightrdf/node_proxy.rb', line 11

def inherited subclass
  subclass.maps(subclass.to_s.gsub("::",":").gsub(/\A.*:/) { |a| a.downcase })
end

#maps(id) ⇒ Object



15
16
17
18
19
# File 'lib/lightrdf/node_proxy.rb', line 15

def maps id
  @rdf_type = Node(id)
  Node.classes.delete Node.classes.invert[self]
  Node.classes[@rdf_type] = self
end