moving to instance variables in parfait

This commit is contained in:
2019-09-09 20:26:54 +03:00
parent fc8de10964
commit 81e3c0c270
21 changed files with 212 additions and 187 deletions

View File

@ -181,4 +181,13 @@ module Parfait
Word: {char_length: :Integer , next_word: :Word} ,
}
end
def self.name_for_index(object , index)
return :type if index == 0
clazz = object.class.name.split("::").last.to_sym
cl = self.type_names[clazz]
keys = cl.keys
keys[index - 1] # -1 because type is excluded in the lists (FIX)
# FIXME Now that we use instance variables in parfait, they should be parsed
# and the type_names generated automatically
end
end