Class: ExceptionHunter::Notifiers::SlackNotifierSerializer

Inherits:
Object
  • Object
show all
Defined in:
lib/exception_hunter/notifiers/slack_notifier_serializer.rb

Class Method Summary collapse

Class Method Details

.deserialize(hash) ⇒ Object



12
13
14
15
16
17
# File 'lib/exception_hunter/notifiers/slack_notifier_serializer.rb', line 12

def self.deserialize(hash)
  ExceptionHunter::Notifiers::SlackNotifier.new(
    hash[:error],
    hash[:notifier].deep_symbolize_keys
  )
end

.serialize(slack_notifier) ⇒ Object



5
6
7
8
9
10
# File 'lib/exception_hunter/notifiers/slack_notifier_serializer.rb', line 5

def self.serialize(slack_notifier)
  {
    error: slack_notifier.error,
    notifier: slack_notifier.notifier.as_json
  }
end