You can use the Module#included
method to do this. I think you will need to modify your class definition slightly to use class_eval
. I've tested the following and it works as expected:
module Sinatra
module FooHelper
def self.included(mod)
::Numeric.class_eval do
def my_new_method
return "whatever"
end
end
end
end
end