mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-23 14:29:31 +00:00
22 lines
563 B
Ruby
22 lines
563 B
Ruby
module ActiveModel
|
|
class Serializer
|
|
class Adapter
|
|
extend ActiveSupport::Autoload
|
|
autoload :SimpleAdapter
|
|
autoload :NullAdapter
|
|
|
|
def initialize(serializer)
|
|
@attributes = serializer.attributes
|
|
end
|
|
|
|
def serializable_hash(options = {})
|
|
raise NotImplementedError, 'This is abstract method. Should be implemented at concrete adapter.'
|
|
end
|
|
|
|
def to_json(options = {})
|
|
raise NotImplementedError, 'This is abstract method. Should be implemented at concrete adapter.'
|
|
end
|
|
end
|
|
end
|
|
end
|