启发由DataMapper的使用混入怎么样,我需要了解如何复制使用混入以下红宝石混入物业
module Property
def property(name, type, value)
#Some code
end
end
class Weapon
include Property
property :name, :string, "The legendary Sword"
property :attack, :integer, 10
end
class Item
include Property
property :name, :string, "Magic Carpet"
property :description, :string, "Fly you to the moon"
end
但我有一个错误,
NoMethodError: undefined method `property' for Route:Class
任何帮助是非常赞赏。谢谢。
阿里嗨, 感谢您详细的解释。 –
@GavinYap没问题:) –