Class: Syncano::Resources::Notifications::Update

Inherits:
Base
  • Object
show all
Defined in:
lib/syncano/resources/notifications/update.rb

Overview

Notification resource about updating data object - represents notification with type “change”

Instance Attribute Summary

Attributes inherited from Base

#attributes, #destroyed, #id

Instance Method Summary collapse

Methods inherited from Base

all, create, instantize_notification

Methods inherited from Base

#[], #[]=, all, #batch, batch_create, #batch_destroy, #batch_save, #batch_update, count, create, #destroy, #destroyed?, find, #new_record?, #reload!, #save, #saved?, #update

Constructor Details

#initialize(client, attributes) ⇒ Update

Constructor for Syncano::Notifications::Update object

Parameters:



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/syncano/resources/notifications/update.rb', line 9

def initialize(client, attributes)
  super(client, attributes)

  if attributes.is_a?(::Syncano::Packets::Base)
    self.attributes = {
      added: attributes.data[:added],
      updated: attributes.data[:updated],
      deleted: attributes.data[:deleted],
      target: attributes.target
    }
  end
end