Class: AcidicJob::Serializers::FinishedPointSerializer

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

Instance Method Summary collapse

Instance Method Details

#deserialize(hash) ⇒ Object



14
15
16
17
# File 'lib/acidic_job/serializers/finished_point_serializer.rb', line 14

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

#serialize(finished_point) ⇒ Object



8
9
10
11
12
# File 'lib/acidic_job/serializers/finished_point_serializer.rb', line 8

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

#serialize?(argument) ⇒ Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/acidic_job/serializers/finished_point_serializer.rb', line 19

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