class ActiveResource::ActiveJobSerializer
Public Instance Methods
deserialize(hash)
click to toggle source
# File lib/active_resource/active_job_serializer.rb, line 14 def deserialize(hash) hash["class"].constantize.new(hash["attributes"]).tap do |resource| resource.persisted = hash["persisted"] resource.prefix_options = hash["prefix_options"] end end
serialize(resource)
click to toggle source
Calls superclass method
# File lib/active_resource/active_job_serializer.rb, line 5 def serialize(resource) super( "class" => resource.class.name, "persisted" => resource.persisted?, "prefix_options" => resource.prefix_options.as_json, "attributes" => resource.attributes.as_json ) end
Private Instance Methods
klass()
click to toggle source
# File lib/active_resource/active_job_serializer.rb, line 22 def klass ActiveResource::Base end