如果我在我的Rails里有这样的东西。model
这两者有什么不同?
class A::B::C < ApplicationRecord
....
end
module A
module B
class C < ApplicationRecord
....
end
end
end
谢谢你的回答。
两者是一样的。
module A
module B
class C
def test
puts "hii"
end
end
end
end
ob = A::B::C.new()
ob.test => hi
class A::B::C
def testing
puts "hello"
end
end
ob1 = A::B::C.new()
ob1.testing => hello
希望能弄清楚这个概念...