lib/ivy/serializers/registry.rb in ivy-serializers-0.2.0 vs lib/ivy/serializers/registry.rb in ivy-serializers-0.3.0
- old
+ new
@@ -5,15 +5,19 @@
class Registry
def initialize
@mappings = Hash.new { |hash, klass| hash[klass] = new_mapping(klass) }
end
- def links(generator, resource)
- mapping_for(resource.class).links(generator, resource)
+ def attributes(generator, resource)
+ mapping_for(resource.class).generate_attributes(generator, resource)
end
def map(klass, &block)
mapping_for(klass).instance_eval(&block)
+ end
+
+ def relationships(generator, resource)
+ mapping_for(resource.class).relationships(generator, resource)
end
def resource(generator, resource)
mapping_for(resource.class).resource(generator, resource)
end