1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
This commit is contained in:
Benoit Daloze 2020-07-27 21:41:08 +02:00
parent 7429841ab6
commit 126fd5f15c
38 changed files with 733 additions and 44 deletions

View file

@ -3,6 +3,10 @@ module ModuleSpecs
def foo; "foo" end
end
class ClassWithSuperFoo
def foo; [:C] end
end
module PrependedModule
def foo; "foo from prepended module"; end
end
@ -11,7 +15,11 @@ module ModuleSpecs
def foo; "foo from included module"; end
end
def self.build_refined_class
Class.new(ClassWithFoo)
def self.build_refined_class(for_super: false)
if for_super
Class.new(ClassWithSuperFoo)
else
Class.new(ClassWithFoo)
end
end
end