Class: Notifications::Client::Template

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

Constant Summary collapse

FIELDS =
%i(
  id
  type
  name
  created_at
  updated_at
  created_by
  version
  body
  subject
).freeze

Instance Method Summary collapse

Constructor Details

#initialize(notification) ⇒ Template

Returns a new instance of Template.



20
21
22
23
24
# File 'lib/notifications/client/response_template.rb', line 20

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