module NotificationHub::DeviceManager
Public Class Methods
create_device(association_model_id, channel_code, device_details)
click to toggle source
# File lib/notification_hub/device_manager.rb, line 5 def create_device(association_model_id, channel_code, device_details) NotificationHub::Device.where("#{NotificationHub.association_model}_id" => association_model_id, channel_code: channel_code).where(device_details).first_or_create! end
delete_device(id)
click to toggle source
# File lib/notification_hub/device_manager.rb, line 14 def delete_device(id) NotificationHub::Device.find(id).destroy end
update_device(id, device_details)
click to toggle source
# File lib/notification_hub/device_manager.rb, line 10 def update_device(id, device_details) device = NotificationHub::Device.find(id).update_attributes(device_details) end