我讀的https://github.com/plataformatec/devise一些源代碼,發現該行的代碼:字符串塊(<< - BLOCK,param1,param2)是什麼意思?
class_eval <<-URL_HELPERS, __FILE__, __LINE__ + 1
什麼PARAMS __FILE__
和__LINE__ + 1
確實在塊聲明(字符串中的塊的關係沒有這些PARAMS什麼樣的變化)?
https://github.com/plataformatec/devise/blob/master/lib/devise/controllers/url_helpers.rb#L47
感謝
我的意思是params對字符串塊聲明的影響,而不是class_eval方法 – daniloisr 2012-03-23 14:10:26
@daniloisr我已經更新了答案。 – 2012-03-23 14:18:56
不錯,我無法想象。非常感謝你=) – daniloisr 2012-03-23 14:27:43