Class: Notifications::Client::Template
- Inherits:
-
Object
- Object
- Notifications::Client::Template
- Defined in:
- lib/notifications/client/response_template.rb
Constant Summary collapse
- FIELDS =
i( id type created_at updated_at created_by version body subject ).freeze
Instance Method Summary collapse
-
#initialize(notification) ⇒ Template
constructor
A new instance of Template.
Constructor Details
#initialize(notification) ⇒ Template
Returns a new instance of Template.
19 20 21 22 23 |
# File 'lib/notifications/client/response_template.rb', line 19 def initialize(notification) FIELDS.each do |field| instance_variable_set(:"@#{field}", notification.fetch(field.to_s, nil)) end end |