Class: RecoveryPointSerializer

Inherits:
ActiveJob::Serializers::ObjectSerializer
  • Object
show all
Defined in:
lib/acidic_job/serializer.rb

Instance Method Summary collapse

Instance Method Details

#deserialize(hash) ⇒ Object



86
87
88
89
# File 'lib/acidic_job/serializer.rb', line 86

def deserialize(hash)
  recovery_point_class = hash["class"].constantize
  recovery_point_class.new(hash["name"])
end

#serialize(recovery_point) ⇒ Object



79
80
81
82
83
84
# File 'lib/acidic_job/serializer.rb', line 79

def serialize(recovery_point)
  super(
    "class" => recovery_point.class.name,
    "name" => recovery_point.name
  )
end

#serialize?(argument) ⇒ Boolean

Returns:

  • (Boolean)


91
92
93
# File 'lib/acidic_job/serializer.rb', line 91

def serialize?(argument)
  defined?(::AcidicJob::RecoveryPoint) && argument.is_a?(::AcidicJob::RecoveryPoint)
end