Class: Urbanairship::Devices::APID

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

Constant Summary

Constants included from Common

Common::CONTENT_TYPE

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')) ⇒ APID

Returns a new instance of APID.



89
90
91
# File 'lib/urbanairship/devices/devicelist.rb', line 89

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

Instance Method Details

#lookup(apid: required('apid')) ⇒ Object



93
94
95
96
97
98
99
100
101
102
# File 'lib/urbanairship/devices/devicelist.rb', line 93

def lookup(apid: required('apid'))
  fail ArgumentError, 'apid needs to be a string' unless apid.is_a? String

  resp = @client.send_request(
    method: 'GET',
    path: apid_path(apid)
  )
  logger.info("Retrieved info on apid #{apid}")
  resp
end