Class: TACore::Gateway

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

Overview

> Gateway 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

.find(token, client_id, gateway_id) ⇒ Array<Object, Object>

Gets the Gateway by ID

Parameters:

  • token (String)

    Client Token after Authentication

  • client_id (String)

    used from Client.create

  • gateway_id (String)

    Gateway ID

Returns:

  • (Array<Object, Object>)

    in JSON format



28
29
30
# File 'lib/tacore/gateway.rb', line 28

def self.find(token, client_id, gateway_id)
  request(:get, '/gateway/' + gateway_id.to_s, {}, {token: token, "client-id" => client_id})
end

.sees(token, client_id, gateway_id) ⇒ Array<Object, Object>

Shows the devices that are seen by the gateway id

Parameters:

  • token (String)

    Client Token after Authentication

  • client_id (String)

    used from Client.create

  • gateway_id (String)

    Gateway ID

Returns:

  • (Array<Object, Object>)

    in JSON format



9
10
11
# File 'lib/tacore/gateway.rb', line 9

def self.sees(token, client_id, gateway_id)
  request(:get, '/gateway/' + gateway_id.to_s + '/sees', {}, {token: token, "client-id" => client_id})
end

.sees_with_options(token, client_id, gateway_id, options) ⇒ Array<Object, Object>

Shows the devices that are seen by the gateway id with options to query with

Parameters:

  • token (String)

    Client Token after Authentication

  • client_id (String)

    used from Client.create

  • gateway_id (String)

    Gateway ID

  • options (String)

    Options

Returns:

  • (Array<Object, Object>)

    in JSON format



19
20
21
# File 'lib/tacore/gateway.rb', line 19

def self.sees_with_options(token, client_id, gateway_id, options)
  request(:get, '/gateway/' + gateway_id.to_s + '/sees' + '?' + options, {}, {token: token, "client-id" => client_id})
end

.update(token, client_id, gateway_id, gateway = {}) ⇒ Array<Object, Object>

Updates Gateway venue_id

Parameters:

  • token (String)

    Client Token after Authentication

  • client_id (String)

    used from Client.create

  • gateway_id (String)

    Gateway ID

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

Returns:

  • (Array<Object, Object>)

    in JSON format



38
39
40
# File 'lib/tacore/gateway.rb', line 38

def self.update(token, client_id, gateway_id, gateway = {})
  request(:put, '/gateway/' + gateway_id.to_s, gateway, {token: token, "client-id" => client_id})
end