class TACore::Venue

> Venue is used to group devices for Clients, Venue could be a location or an area within a location.

It is important to note that all Venue methods require the use a client_id see {Client.create}.

Public Class Methods

all(token) click to toggle source

Display all Venues for the client @param token [String] Client Token after Authentication @param client_id [String] used from {Client.create} @return [Array<Object, Object>] in JSON format

# File lib/tacore/venue.rb, line 35
def self.all(token)
  # returns all venues that belong to this client
  request(:get, '/venues', {}, {"token": token})
end
create(token, venue = {}) click to toggle source

Create a new Venue @param token [String] Client Token after Authentication @param venue [Object] Venue params @note Venue currently only accepts 'name' @return [Object] in JSON format

# File lib/tacore/venue.rb, line 10
def self.create(token, venue = {})
  request(:post, '/venue', venue, {"token": token})
end
destroy(token, venue_id) click to toggle source

This method will permanently remove the venue from the API. @param token [String] Client Token after Authentication @param client_id [String] used from {Client.create} @param venue_id [String] the Key of the Venue from {Venue.create} @return [Hash, status: 410] in JSON format

# File lib/tacore/venue.rb, line 45
def self.destroy(token, venue_id)
  request(:delete, '/venue/' + venue_id.to_s,{}, {"token": token})
end
devices(token, venue_id) click to toggle source

Get all devices belonging to the given venue @param token [String] Client Token after Authentication @param venue_id [String] the Key of the Venue from {Venue.create} @return [Hash, status: 200] in JSON format

# File lib/tacore/venue.rb, line 53
def self.devices(token, venue_id)
  request(:get, '/venue/' + venue_id.to_s + '/devices',{}, {"token": token})
end
find(token, venue_id) click to toggle source

Get back Venue information @param token [String] Client Token after Authentication @param venue_id [String] used from {Venue.create} @return [Object] in JSON format

# File lib/tacore/venue.rb, line 27
def self.find(token, venue_id)
  request(:get, '/venue/' + venue_id.to_s,{}, {"token": token})
end
update(token, venue_id, venue = {}) click to toggle source

Update a Venue. @param token [String] Client Token after Authentication @param venue [Object] Venue params @note Venue currently only accepts 'name' @return [Object] in JSON format

# File lib/tacore/venue.rb, line 19
def self.update(token, venue_id, venue = {})
  request(:put, '/venue/' + venue_id.to_s, venue, {"token": token})
end