Class: Notifications::Client::ResponseNotification

Inherits:
Object
  • Object
show all
Defined in:
lib/notifications/client/response_notification.rb

Constant Summary collapse

FIELDS =
%i(
  id
  reference
  content
  template
  uri
  sanitised_content
).freeze

Instance Method Summary collapse

Constructor Details

#initialize(notification) ⇒ ResponseNotification

Returns a new instance of ResponseNotification.



15
16
17
18
19
# File 'lib/notifications/client/response_notification.rb', line 15

def initialize(notification)
  FIELDS.each do |field|
    instance_variable_set(:"@#{field}", notification.fetch(field.to_s, nil))
  end
end