module A
  def hello
    puts "Hello"
  end

  define_method(:hi) do |*args, **kwargs|
    puts "hi"
  end

  class_eval(<<~RUBY, __FILE__, __LINE__ + 1)
    def ahoy(*args, **kwargs)
      puts "ahoy"
    end
  RUBY
end


class B
  include A
end

b = B.new
b.hello
b.ahoy
b.hi

r = Ractor.new do
  b2 = B.new
  b2.hello
  b2.ahoy
  b2.hi
end
r.join
