The following example:
class Person
extend Attributable
attributes :name
end
class Employee < Person
attributes :salary
end
Defining Employee results in two calls to Attributable#add_instance_methods and hence Attributable's define_method logic is called twice (once with attributes = {name: nil} and once with attributes = {name: nil, salary: nil}).
It seems redundant to add these methods more than once.
The following example:
Defining
Employeeresults in two calls toAttributable#add_instance_methodsand hence Attributable'sdefine_methodlogic is called twice (once withattributes = {name: nil}and once withattributes = {name: nil, salary: nil}).It seems redundant to add these methods more than once.