t6d / smart_properties

Ruby accessors on steroids
MIT License
177 stars 20 forks source link

Support for multiple inheritance #87

Closed t6d closed 3 years ago

t6d commented 3 years ago

SmartProperties now allows modules to define properties just like classes do and ensures that all properties are eventually included into the target class. Multiple inheritance was previously not supported or required custom included hooks.

module PII
  include SmartProperties
  property! :name, accepts: String
  property! :email, accepts: String
end

module Job
  property! :title, accepts: String
  property! :company, accepts: String
end

class Person
  include PII
  include Job
end