diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2018-02-09 14:34:29 -0500 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2018-02-14 13:10:07 -0500 |
commit | 9bc8b4bbde4634e0e4bddcffa25e0bf8d74d19cd (patch) | |
tree | 7ceb485b32511940c2ab0baed2ebacdb9adae360 /activejob/lib/active_job/serializers | |
parent | 803f4385c6c30217e3d2cf81cbaba92c7bc58476 (diff) | |
download | rails-9bc8b4bbde4634e0e4bddcffa25e0bf8d74d19cd.tar.gz rails-9bc8b4bbde4634e0e4bddcffa25e0bf8d74d19cd.tar.bz2 rails-9bc8b4bbde4634e0e4bddcffa25e0bf8d74d19cd.zip |
Define the interface of a Serializer
Diffstat (limited to 'activejob/lib/active_job/serializers')
-rw-r--r-- | activejob/lib/active_job/serializers/base_serializer.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/activejob/lib/active_job/serializers/base_serializer.rb b/activejob/lib/active_job/serializers/base_serializer.rb index 98f7852fd6..8b891cca48 100644 --- a/activejob/lib/active_job/serializers/base_serializer.rb +++ b/activejob/lib/active_job/serializers/base_serializer.rb @@ -7,6 +7,24 @@ module ActiveJob def serialize?(argument) argument.is_a?(klass) end + + def deserialize?(_argument) + raise NotImplementedError + end + + def serialize(_argument) + raise NotImplementedError + end + + def deserialize(_argument) + raise NotImplementedError + end + + private + + def klass + raise NotImplementedError + end end end end |