rename singleton_class to single_class and misc
was clashing with real ruby method name also many superclass mismatch fixes some misc
This commit is contained in:
@ -59,7 +59,7 @@ module Vool
|
||||
when MethodExpression
|
||||
node.to_mom(@clazz)
|
||||
when ClassMethodExpression
|
||||
node.to_mom(@clazz.singleton_class)
|
||||
node.to_mom(@clazz.single_class)
|
||||
else
|
||||
raise "Only methods for now #{node.class}:#{node}"
|
||||
end
|
||||
@ -78,7 +78,7 @@ module Vool
|
||||
when MethodExpression
|
||||
target = @clazz
|
||||
when ClassMethodExpression
|
||||
target = @clazz.singleton_class
|
||||
target = @clazz.single_class
|
||||
else
|
||||
raise "Only methods for now #{node.class}:#{node}"
|
||||
end
|
||||
|
@ -12,11 +12,11 @@ module Vool
|
||||
# Must pass in the actual Parfait class (default nil is just to conform to api)
|
||||
def to_parfait( clazz = nil )
|
||||
raise "No class given to class method #{name}" unless clazz
|
||||
clazz.add_instance_method_for(name , make_arg_type , make_frame , body )
|
||||
clazz.single_class.add_instance_method_for(name , make_arg_type , make_frame , body )
|
||||
end
|
||||
|
||||
def to_mom(clazz)
|
||||
raise "not singleton" unless clazz.class == Parfait::SingletonClass
|
||||
raise "not singleton #{clazz.class}" unless clazz.class == Parfait::SingletonClass
|
||||
raise( "no class in #{self}") unless clazz
|
||||
method = clazz.get_instance_method(name )
|
||||
raise( "no class method in #{@name} in #{clazz}") unless method
|
||||
|
@ -49,7 +49,7 @@ module Vool
|
||||
class ModuleName < Expression
|
||||
include Named
|
||||
def ct_type
|
||||
get_named_class.singleton_class.instance_type
|
||||
get_named_class.single_class.instance_type
|
||||
end
|
||||
def to_slot(_)
|
||||
return Mom::SlotDefinition.new( get_named_class, [])
|
||||
|
Reference in New Issue
Block a user