From: Yukihiro Matsumoto Date: 2006-04-07T00:35:41+09:00 Subject: Re: un_include and un_extend Hi, In message "Re: un_include and un_extend" on Thu, 6 Apr 2006 21:28:46 +0900, "Austin Ziegler" writes: |I'd love to change your mind about that. One reason is |Transaction::Simple. My preferred use of Transaction::Simple will not |be including it into a class, but extending an object with it like so: | | foo = "mystring" | Transaction::Simple.start(foo) do |t_foo| | t_foo.gsub!(/my/, "your") | t_foo.rewind_transaction | t_foo.gsub!(/string/, "test") | end | t_foo.start_transaction # I want *this* to throw an exception. | |It would make certain things easier to manage in classes that use |Transaction::Simple. I understand that it wouldn't be easy, and it |would be almost impossible to automate, so perhaps only allowing it on |modules that have an #unextended method? Hmm, raising NoMethodError for such case sounds like bad manner for me, since the real reason of the error is non-existence of the method, but being out of transaction, I guess. PStore does similar thing, but it doesn't raise NoMethodError but PStore::Error for the reason. Am I missing something? matz.