Class: Flipper::Notifications::EventSerializer
- Inherits:
-
ActiveJob::Serializers::ObjectSerializer
- Object
- ActiveJob::Serializers::ObjectSerializer
- Flipper::Notifications::EventSerializer
- Defined in:
- lib/flipper/notifications/event_serializer.rb
Instance Method Summary collapse
- #deserialize(hash) ⇒ Object
- #klass ⇒ Object
- #serialize(event) ⇒ Object
- #serialize?(argument) ⇒ Boolean
Instance Method Details
#deserialize(hash) ⇒ Object
25 26 27 |
# File 'lib/flipper/notifications/event_serializer.rb', line 25 def deserialize(hash) FeatureEvent.new(**hash.symbolize_keys.slice(:feature_name, :operation)) end |
#klass ⇒ Object
10 11 12 |
# File 'lib/flipper/notifications/event_serializer.rb', line 10 def klass FeatureEvent end |
#serialize(event) ⇒ Object
18 19 20 21 22 23 |
# File 'lib/flipper/notifications/event_serializer.rb', line 18 def serialize(event) super( feature_name: event.feature.name, operation: event.operation ) end |
#serialize?(argument) ⇒ Boolean
14 15 16 |
# File 'lib/flipper/notifications/event_serializer.rb', line 14 def serialize?(argument) argument.is_a?(FeatureEvent) end |