私はこのようなものを作りたいです:
class Result<<ActiveRecord::Base
def condensation
#some code here that calculates @winner and @looser and @condresalut
def winner
@winner
end
def looser
@looser
end
def showresault
@condresalut
end
end
end
res.condensation.winnerandres.condensation.looserとを呼び出せるようにしres.condensation.showresaultます。
それを行う最良の方法は何ですか?どうやらこの方法ではうまくいかないので、nilを取得しました。