mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-23 06:16:50 +00:00
This adapter basically doesn't do anything, and just serializes the attributes into plain old JSON.
18 lines
349 B
Ruby
18 lines
349 B
Ruby
module ActiveModel
|
|
class Serializer
|
|
class Adapter
|
|
class NullAdapter
|
|
def initialize(serializer)
|
|
@serializer = serializer
|
|
end
|
|
|
|
def to_json
|
|
@serializer.attributes.each_with_object({}) do |(attr, value), h|
|
|
h[attr] = value
|
|
end.to_json
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|