t6d / smart_properties

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

Accepts responds_to properties #55

Closed tostart-pickagreatname closed 5 years ago

tostart-pickagreatname commented 7 years ago

Purpose: Allow a property to specify a type by its method names to ensure that later calls to those names succeed without needing to specify a specific class. This would put the focus on behaviour and interface. Right now if I want to mixin behaviour to a number of classes and allow a class to work with all those examples I must use inheritance or generate a long list of classes that can be accepted, or avoid checking acceptance.

tostart-pickagreatname commented 7 years ago

Let me know what you think of the idea. We can certainly add more complexity to specifying messages (arguments, etc.), but I wanted to start simple so we could discuss it.