1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/spec/ruby/core/module/fixtures/refine.rb
2020-07-27 21:41:08 +02:00

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