mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
25 lines
437 B
Ruby
25 lines
437 B
Ruby
module ModuleSpecs
|
|
class ClassWithFoo
|
|
def foo; "foo" end
|
|
end
|
|
|
|
class ClassWithSuperFoo
|
|
def foo; [:C] end
|
|
end
|
|
|
|
module PrependedModule
|
|
def foo; "foo from prepended module"; end
|
|
end
|
|
|
|
module IncludedModule
|
|
def foo; "foo from included module"; end
|
|
end
|
|
|
|
def self.build_refined_class(for_super: false)
|
|
if for_super
|
|
Class.new(ClassWithSuperFoo)
|
|
else
|
|
Class.new(ClassWithFoo)
|
|
end
|
|
end
|
|
end
|