lib/json_serializer.rb in json-serializer-0.0.8 vs lib/json_serializer.rb in json-serializer-0.0.9

- old
+ new

@@ -9,9 +9,15 @@ else name end end end + def self.inherited(subclass) + attributes.each do |name, serializer| + subclass.attribute(name, serializer) + end + end + def self.attribute(name, serializer = nil) attributes[name] ||= serializer end def self.attributes