Method: SparkApi::Models::Notification#save

Defined in:
lib/spark_api/models/notification.rb

#save(arguments = {}) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/spark_api/models/notification.rb', line 7

def save(arguments={})
  self.errors = [] # clear the errors hash
  begin
    return save!(arguments)
  rescue BadResourceRequest => e
    self.errors << {:code => e.code, :message => e.message}
    SparkApi.logger.warn("Failed to save resource #{self}: #{e.message}")
  rescue NotFound => e
    SparkApi.logger.error("Failed to save resource #{self}: #{e.message}")
  end
  false
end