From: "shugo (Shugo Maeda)" Date: 2012-11-02T18:11:53+09:00 Subject: [ruby-dev:46363] [ruby-trunk - Bug #7262][Assigned] module extension (#include/#prepend) in refinements Issue #7262 has been updated by shugo (Shugo Maeda). Status changed from Open to Assigned ---------------------------------------- Bug #7262: module extension (#include/#prepend) in refinements https://bugs.ruby-lang.org/issues/7262#change-32220 Author: matz (Yukihiro Matsumoto) Status: Assigned Priority: Normal Assignee: shugo (Shugo Maeda) Category: core Target version: 2.0.0 ruby -v: ruby 2.0.0dev (2012-11-01 trunk 37415) [i486-linux] refinementの中でモジュールのincludeやprependがしたい(かつ、そのスコープの範囲内だけで有効にしたい)なんて思ったんですが、きっと困難ですよね。 「無理」と思ったら遠慮なくrejectしてください。 module Experiment refine String do include Enumerable def foo; p :foo; end end end using Experiment "foo".foo "foo".each(&:p) Matz. -- http://bugs.ruby-lang.org/