class Syncthing::Helper::API::DevicesUpdater
Public Instance Methods
devices_added()
click to toggle source
TODO: validate input!
# File lib/syncthing/helper/api/updater.rb, line 42 def devices_added device_exists = @config_obj.devices.find{ |d| d['deviceID'] == @chng_obj.doc.document_id } unless device_exists new_device = @config_obj.devices.first.dup new_device['deviceID'] = @chng_obj.doc.document_id new_device['name'] = @chng_obj.doc.data[:label] new_device['compression'] = 'always' @config_obj.devices << new_device Logger.tagged('config_api: ' + @col.singularize + '/add') { Logger.debug @chng_obj.doc.document_id } end end
Also aliased as: devices_modified