small rename
This commit is contained in:
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user