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

Instance Method Summary collapse

Constructor Details

#initialize(notification) ⇒ Template

Returns a new instance of Template.



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

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