Greets to all! I want to describe each kind of product by a class:
# Base product class
class BaseProduct
prop :name, :price # Common properties for all inheritable products
end
class Cellphone < BaseProduct
prop :imei # Concrete property for this product
end
class Auto < BaseProduct
prop :max_speed, :color # Concrete properties for this product
end
c = Cellphone.new
c.prop_names # => [:name, :price, :imei]
a = Auto.new
c.prop_names # => [:name, :price, :max_speed, :color]
So, how to implement this? I spent 3 days on it but got no working code(