direct index access helper for type

This commit is contained in:
Torsten Ruger
2018-07-15 12:30:50 +03:00
parent ab8b574e9c
commit 648ec772ec
2 changed files with 17 additions and 2 deletions

View File

@ -205,6 +205,12 @@ module Parfait
@types.get(index)
end
def type_for( name )
index = variable_index(name)
return nil unless index
type_at(index)
end
def inspect
"Type[#{names.inspect}]"
end