1
module Test1
module Test2
def self.included(base)
# Where can I declare constant ? How ?
base.extend ClassMethods
base.class_eval do
# named scopes
end
end
end
end
class abc
include Test1::Test2
end
我可以在哪里声明常量?怎么样 ?如何在模块中写入常量?
不是'开头',而是全部大写 – Tim
@Tim,菜鸟railer是正确的。 Ruby常量* start_with *大写字母。 类实际上是Ruby中的常量。 – olivervbk