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
).freeze

Instance Method Summary collapse

Constructor Details

#initialize(notification) ⇒ ResponseNotification

Returns a new instance of ResponseNotification.



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

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