small rename

This commit is contained in:
Torsten Ruger
2016-12-19 14:16:10 +02:00
parent 107e3e6d58
commit af9fed863f
5 changed files with 8 additions and 8 deletions

View File

@ -111,7 +111,7 @@ module Typed
raise "create_method #{type.inspect} is not a Type" unless type.is_a? Parfait::Type
raise "Args must be Hash #{args}" unless args.is_a?(Hash)
raise "create_method #{method_name}.#{method_name.class}" unless method_name.is_a? Symbol
arguments = Parfait::Type.new_for_hash( type.object_class , args )
arguments = Parfait::Type.for_hash( type.object_class , args )
@method = type.create_instance_method( method_name , arguments)
self
end

View File

@ -38,7 +38,7 @@ module Parfait
include Indexed
self.offset(3)
def self.new_for_hash( object_class , hash)
def self.for_hash( object_class , hash)
new_type = Type.new( object_class , hash)
code = new_type.hash
Space.object_space.types[code] = new_type
@ -83,7 +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)
arguments = Parfait::Type.for_hash( self.object_class , arguments) if arguments.is_a?(Hash)
add_instance_method TypedMethod.new( self , method_name , arguments )
end
@ -138,7 +138,7 @@ module Parfait
if existing
return existing
else
return Type.new_for_hash( object_class , hash)
return Type.for_hash( object_class , hash)
end
end