little fat of meta class
meta is firmly in the ruby world, not implemented in type world
This commit is contained in:
parent
f7e01ff05e
commit
516bbd10b7
@ -37,9 +37,6 @@ module Parfait
|
||||
def get_instance_method fname
|
||||
self.object.get_type.get_instance_method fname
|
||||
end
|
||||
def resolve_method m_name
|
||||
self.object.get_type.resolve_method m_name
|
||||
end
|
||||
|
||||
# the modifying part creates a new type
|
||||
# forwards the action and replaces the type
|
||||
@ -57,12 +54,5 @@ module Parfait
|
||||
ret
|
||||
end
|
||||
|
||||
def create_instance_method method_name , arguments
|
||||
raise "create_instance_method #{method_name}.#{method_name.class}" unless method_name.is_a?(Symbol)
|
||||
log.debug "Add_method: #{method_name} clazz: #{self.name}"
|
||||
add_instance_method TypedMethod.new( self , method_name , arguments )
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
end
|
||||
|
@ -13,20 +13,19 @@ class TestMeta < MiniTest::Test
|
||||
end
|
||||
|
||||
def test_meta
|
||||
assert @try
|
||||
assert @try.name
|
||||
end
|
||||
|
||||
def test_meta_object
|
||||
assert @space.get_class_by_name(:Object).meta
|
||||
end
|
||||
|
||||
def test_new_methods
|
||||
def test_no_methods
|
||||
assert_equal 0 , @try.method_names.get_length
|
||||
end
|
||||
|
||||
def test_create_method
|
||||
#FIXME args = Parfait::Type.new_for_hash( @try , { bar: :Integer})
|
||||
# @try.create_instance_method :bar, args
|
||||
# assert_equal ":bar" , @try.method_names.inspect
|
||||
def test_meta_methods
|
||||
assert @try.methods
|
||||
end
|
||||
|
||||
def test_add_method
|
||||
|
Loading…
x
Reference in New Issue
Block a user