o = Object.new
def o.to_str
" "
end
"Hello, world!".sub(o, "-")
# Expect(CRuby) => "Hello,-world!"
# Actual => wrong argument type Object (expected Data) (TypeError)
I think, it's more good that mruby-onig-regexp's methods delegate to cores if args are all none OnigRegexp objects instead of string.
Then, I think conversion using to_str is core work.
I think, it's more good that mruby-onig-regexp's methods delegate to cores if args are all none OnigRegexp objects instead of string. Then, I think conversion using
to_str
is core work.