1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activejob/lib/active_job/serializers/symbol_serializer.rb

20 lines
331 B
Ruby
Raw Normal View History

2018-02-09 15:45:11 -05:00
module ActiveJob
module Serializers
class SymbolSerializer < ObjectSerializer # :nodoc:
def serialize(argument)
super("value" => argument.to_s)
end
2018-02-09 15:45:11 -05:00
def deserialize(argument)
argument["value"].to_sym
end
2018-02-09 15:45:11 -05:00
private
2018-02-09 15:45:11 -05:00
def klass
Symbol
end
end
end
end