0
比方說,我有:如何在ruby初始化後立即調用方法?
module Something
class SomethingElse
def initialize(args)
@args = args
end
def some_method
#stuff
end
end
end
有沒有一種方法,我可以得到some_method右後intialize自動運行,但沒有從初始化方法中調用some_method?
[initialize方法後運行的方法]的可能的複製(https://stackoverflow.com/questions/23075010/running-a-method-after-the-initialize-method) – 2017-10-05 05:03:39