type converts method args if needed

This commit is contained in:
Torsten Ruger 2016-12-17 00:17:54 +02:00
parent 681b53cc4c
commit 5c34835ae3

View File

@ -83,6 +83,7 @@ module Parfait
def create_instance_method( method_name , arguments )
raise "create_instance_method #{method_name}.#{method_name.class}" unless method_name.is_a?(Symbol)
#puts "Self: #{self.class} clazz: #{clazz.name}"
arguments = Parfait::Type.new_for_hash( self.object_class , arguments) if arguments.is_a?(Hash)
add_instance_method TypedMethod.new( self , method_name , arguments )
end