lib/ivy/serializers/serializer.rb in ivy-serializers-0.2.0 vs lib/ivy/serializers/serializer.rb in ivy-serializers-0.3.0

- old
+ new

@@ -4,16 +4,20 @@ module Serializers class Serializer class << self attr_accessor :_registry + def attributes(generator, resource) + _registry.attributes(generator, resource) + end + def inherited(base) base._registry = Registry.new end - def links(generator, resource) - _registry.links(generator, resource) + def relationships(generator, resource) + _registry.relationships(generator, resource) end def map(klass, &block) _registry.map(klass, &block) end @@ -21,11 +25,15 @@ def resource(generator, resource) _registry.resource(generator, resource) end end - def links(generator, links) - self.class.links(generator, links) + def attributes(generator, resource) + self.class.attributes(generator, resource) + end + + def relationships(generator, resource) + self.class.relationships(generator, resource) end def resource(generator, resource) self.class.resource(generator, resource) end