2013-06-12 57 views

回答

1

在定义方法时添加配置文件的默认值,并检查它是否不是默认值。

def initialize(profile = nil) 
    if profile 
    @profile = profile 
    @person = profile.person 
    end 
end