rename typed_method to callable_method

seems to make the essence clearer
also extracted base class
This commit is contained in:
Torsten Ruger
2018-07-07 09:11:09 +03:00
parent acd5cd8f30
commit 9005513368
28 changed files with 146 additions and 142 deletions

View File

@ -22,13 +22,13 @@ module Parfait
end
def test_name
assert_equal "Word_Type" , @types.values.first.name
assert_equal "BinaryCode_Type" , @types.values.first.name
end
def test_to_hash
hash = @first.to_hash
assert_equal hash[:type] , :Type
assert_equal 3 , hash.length
assert_equal 2 , hash.length
end
def test_add_is_different
type = @first.add_instance_variable :random , :Integer

View File

@ -14,7 +14,7 @@ module Parfait
end
def foo_method( for_class = :Try)
args = Parfait::Type.for_hash( @try_class , { bar: :Integer})
::Parfait::TypedMethod.new( @space.get_class_by_name(for_class).instance_type , :foo , args,empty_frame)
::Parfait::CallableMethod.new( @space.get_class_by_name(for_class).instance_type , :foo , args,empty_frame)
end
def add_foo_to( clazz = :Try )
foo = foo_method( clazz )
@ -50,7 +50,7 @@ module Parfait
end
def test_method_get
add_foo_to
assert_equal Parfait::TypedMethod , @try_type.get_method(:foo).class
assert_equal Parfait::CallableMethod , @try_type.get_method(:foo).class
end
def test_method_get_nothere
assert_nil @try_type.get_method(:foo)