small rename and new test for layout

This commit is contained in:
Torsten Ruger
2015-08-08 18:08:47 +03:00
parent 0a54d030b5
commit 5d838056fa
4 changed files with 44 additions and 12 deletions

View File

@ -98,7 +98,7 @@ module Register
real_name = clazz_name.to_s.split('_').last.capitalize.to_sym
clazz = Parfait::Space.object_space.get_class_by_name(real_name)
raise "Class name not given #{real_name}" unless clazz
index = clazz.object_layout.index_of( instance_name )
index = clazz.object_layout.variable_index( instance_name )
raise "Instance name=#{instance_name} not found on #{real_name}" unless index.is_a?(Numeric)
return index # the type word is at index 0, but layout is a list and starts at 1 == layout
end