class MyClass
  def self.new_method(name, &block)
    define_method(name, &block)
  end
end

a,b = 3,79
MyClass.new_method(:compute) { a*b }
x = MyClass.new
puts x.compute           # 237
a,b = 23,24
puts x.compute           # 552

