Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有以下课程:
class Stock include MongoMapper::Document key :name, String key :isin, String end
如何Stock在运行时确定类的键名?
Stock
使用keys方法:
keys
Stock.keys #=> ["name", "isin"]
标签