我已經挖過一些紅寶石創業板代碼,我碰到這些和不知道他們是什麼意思什麼是!!和Ruby中的其他一些東西?
def success?
[email protected]
end
def failure?
[email protected]
end
cattr_accessor :test_response
,最後這個塊的代碼
class_inheritable_accessor :attributes
self.attributes = []
def self.attribute(name, options={})
top_level_name = name.to_s.split(".").last.underscore
define_method top_level_name do
read_attribute name
end
如果你只知道一兩處,這就是罰款...我只是想了解他們...謝謝
爲了使用谷歌搜索,'!'被稱爲bang運算符。 – 2010-10-04 08:40:38
可能重複[什麼!意思是在紅寶石?](http://stackoverflow.com/questions/524658/what-does-mean-in-ruby) – 2010-10-09 21:16:32