Move DefaultSerializer from array_serializer.rb to serializer.rb

This commit is contained in:
Adam Stanton
2013-02-10 09:49:11 -08:00
parent 8f6218c587
commit c4fcf96eb4
3 changed files with 17 additions and 10 deletions

View File

@@ -387,4 +387,20 @@ module ActiveModel
ActiveSupport::Notifications.instrument(event_name, payload, &block)
end
end
# DefaultSerializer
#
# Provides a constant interface for all items, particularly
# for ArraySerializer.
class DefaultSerializer
attr_reader :object, :options
def initialize(object, options={})
@object, @options = object, options
end
def serializable_hash
@object.as_json
end
end
end