Class: Urbanairship::Devices::NamedUserUninstaller

Inherits:
Object
  • Object
show all
Includes:
Common, Loggable
Defined in:
lib/urbanairship/devices/named_user.rb

Constant Summary

Constants included from Common

Common::CONTENT_TYPE

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Loggable

create_logger, logger, #logger

Methods included from Common

#apid_path, #channel_path, #compact_helper, #create_and_send_path, #custom_events_path, #device_token_path, #experiments_path, #lists_path, #named_users_path, #open_channel_path, #pipelines_path, #push_path, #reports_path, #required, #schedules_path, #segments_path, #tag_lists_path, #try_helper

Constructor Details

#initialize(client: required('client')) ⇒ NamedUserUninstaller

Returns a new instance of NamedUserUninstaller.



102
103
104
105
# File 'lib/urbanairship/devices/named_user.rb', line 102

def initialize(client: required('client'))
  @client = client
  @named_user_ids =  nil
end

Instance Attribute Details

#named_user_idsObject

Returns the value of attribute named_user_ids.



100
101
102
# File 'lib/urbanairship/devices/named_user.rb', line 100

def named_user_ids
  @named_user_ids
end

Instance Method Details

#uninstallObject



107
108
109
110
111
112
113
114
115
116
117
118
119
# File 'lib/urbanairship/devices/named_user.rb', line 107

def uninstall
  payload = {}
  payload['named_user_id'] = @named_user_ids

  response = @client.send_request(
    method: 'POST',
    body: JSON.dump(payload),
    path: named_users_path('uninstall'),
    content_type: CONTENT_TYPE
  )
  logger.info { "Uninstalled named_user_ids #{@named_user_ids} " }
  response
end