2012-10-17 48 views

回答

5

取决于上下文。即。你在哪找到这行代码。

class Profile 
    def foo 
    results.merge(profile: self) 
    end 
end 

p = Profile.new 
p.foo 

在这种情况下,“self”将引用对象“p”,它是使用“self”的上下文中的当前对象。

+0

谢谢!!!!!!!!! –

相关问题