Class: TACore::Device

Inherits:
Auth show all
Defined in:
lib/tacore/device.rb

Overview

> Device class methods

Instance Attribute Summary

Attributes inherited from Auth

#client, #token

Attributes inherited from Configuration

#api_key, #api_url, #client_id, #client_secret

Class Method Summary collapse

Methods inherited from Auth

login, request

Methods inherited from Configuration

#initialize

Constructor Details

This class inherits a constructor from TACore::Configuration

Class Method Details

.cirrus(token) ⇒ Array<Object, Object>

Display all cirrus devices that belong to this application

Parameters:

  • token (String)

    Client Token after Authentication

Returns:

  • (Array<Object, Object>)

    in JSON format



34
35
36
# File 'lib/tacore/device.rb', line 34

def self.cirrus(token)
  request(:get, '/application/cirrus', {}, {"token": token})
end

.find(token, client_id, device_id) ⇒ Object

Find device by device_id

Parameters:

  • token (String)

    Client Token after Authentication

  • client_id (String)

    used from Client.create

  • device_id (Integer)

    Device ID

Returns:

  • (Object)

    in JSON format



20
21
22
# File 'lib/tacore/device.rb', line 20

def self.find(token, client_id, device_id)
  request(:get, '/device/' + device_id.to_s,{}, {"token": token})
end

.iris(token) ⇒ Array<Object, Object>

Display all iris devices that belong to this application

Parameters:

  • token (String)

    Client Token after Authentication

Returns:

  • (Array<Object, Object>)

    in JSON format



27
28
29
# File 'lib/tacore/device.rb', line 27

def self.iris(token)
  request(:get, '/application/iris', {}, {"token": token})
end

.update(token, client_id, device_id, device = {}) ⇒ Object

Update a device’s venue_id

Parameters:

  • token (String)

    Client Token after Authentication

  • client_id (String)

    used from Client.create

  • id (Integer)

    Device ID

  • device (Object) (defaults to: {})

    Venue ID as a value

Returns:

  • (Object)

    in JSON format



11
12
13
# File 'lib/tacore/device.rb', line 11

def self.update(token, client_id, device_id, device = {})
  request(:put, '/device/' + device_id.to_s, device, {"token": token})
end