>>>>> "H" == Hal E Fulton <hal9000 / hypermetrics.com> writes:

H> Is this possible?

svg% cat b.rb
#!/usr/bin/ruby
class MyClass
   def meth1
      def self.foo; 123; end
   end

   def meth2
      class << self; undef foo; end
   end
end
      
a = MyClass.new
a.meth1
p a.foo
a.meth2
p a.foo
svg% 

svg% b.rb
123
./b.rb:16: undefined method `foo' for #<MyClass:0x40099d94> (NoMethodError)
svg% 


Guy Decoux