宇宙船の方法と魔法の "method_missing"を1つのクラスで使う方法はありますか?以下の例では、私のようなdefinitonでfoo1 < foo2
を試みるたび私undefined method '<'
与える:感謝"def <=>"対 "def method_missing"
class Foo
def initialize(params)
@parent= params[:parent]
end
def <=>(o)
...
end
def method_missing(sym, *args, &block)
@parent.send sym, *args, &block
end
end
すべてのヘルプ:)私は私はあなたの質問が何であるかを理解していない
method_missingは質問とは関係ありません。 – gtd
本当に - あまりにも長く働いて、明らかに見えませんでした;) – pagid