Class: Notifications::Client::ResponsePrecompiledLetter

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

Constant Summary collapse

FIELDS =
%i(
  id
  reference
  postage
).freeze

Instance Method Summary collapse

Constructor Details

#initialize(notification) ⇒ ResponsePrecompiledLetter

Returns a new instance of ResponsePrecompiledLetter.



12
13
14
15
16
# File 'lib/notifications/client/response_precompiled_letter.rb', line 12

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