Class: Urbanairship::Devices::DeviceToken
- Inherits:
-
Object
- Object
- Urbanairship::Devices::DeviceToken
- Defined in:
- lib/urbanairship/devices/devicelist.rb
Constant Summary
Constants included from Common
Instance Method Summary collapse
-
#initialize(client: required('client')) ⇒ DeviceToken
constructor
A new instance of DeviceToken.
- #lookup(token: required('token')) ⇒ Object
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')) ⇒ DeviceToken
Returns a new instance of DeviceToken.
58 59 60 |
# File 'lib/urbanairship/devices/devicelist.rb', line 58 def initialize(client: required('client')) @client = client end |
Instance Method Details
#lookup(token: required('token')) ⇒ Object
62 63 64 65 66 67 68 69 70 71 |
# File 'lib/urbanairship/devices/devicelist.rb', line 62 def lookup(token: required('token')) fail ArgumentError, 'token needs to be a string' unless token.is_a? String resp = @client.send_request( method: 'GET', path: device_token_path(token) ) logger.info("Looking up info on device token #{token}") resp end |