Closed
Description
module Wrapper
def wrap(meth)
define_method(meth) do |*args, **kwargs, &block|
super(*args, **kwargs, &block)
puts "side effect"
self
end
end
end
class MyString < String
extend Wrapper
wrap :<<
end
MyString.new << "a"
This code prints 'side effect' in cruby but with mruby I get
test.rb:4:in <<: no superclass method 'wrap' (NoMethodError)
What's going on here? This is with latest mruby head.
Thanks :)
Metadata
Metadata
Assignees
Labels
No labels