Moving space to object class
away from Parfait module, as that gets collapsed Leaving shortcut outside parfait for now
This commit is contained in:
@ -45,12 +45,12 @@ module Parfait
|
||||
def self.for_hash( hash , object_class = :Object)
|
||||
name = object_class
|
||||
if(object_class.is_a?(Symbol))
|
||||
object_class = Parfait.object_space.get_class_by_name(object_class)
|
||||
object_class = Object.object_space.get_class_by_name(object_class)
|
||||
end
|
||||
raise "No such class #{name}" unless object_class
|
||||
hash = {type: object_class.name }.merge(hash) unless hash[:type]
|
||||
new_type = Type.new( object_class , hash)
|
||||
Parfait.object_space.add_type(new_type)
|
||||
Object.object_space.add_type(new_type)
|
||||
end
|
||||
|
||||
# should not be called directly. Use Type.for_hash instead, that adds the
|
||||
|
Reference in New Issue
Block a user