Class: TACore::Venue
- Inherits:
-
Auth
- Object
- Configuration
- Auth
- TACore::Venue
- Defined in:
- lib/tacore/venue.rb
Overview
> 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.
Instance Attribute Summary
Attributes inherited from Auth
Attributes inherited from Configuration
#api_key, #api_url, #client_id, #client_secret
Class Method Summary collapse
-
.all(token) ⇒ Array<Object, Object>
Display all Venues for the client.
-
.create(token, venue = {}) ⇒ Object
Create a new Venue.
-
.destroy(token, venue_id) ⇒ Hash, status: 410
This method will permanently remove the venue from the API.
-
.devices(token, venue_id) ⇒ Hash, status: 200
Get all gateways belonging to the given venue.
-
.find(token, venue_id) ⇒ Object
Get back Venue information.
-
.update(token, venue_id, venue = {}) ⇒ Object
Update a Venue.
Methods inherited from Auth
Methods inherited from Configuration
Constructor Details
This class inherits a constructor from TACore::Configuration
Class Method Details
.all(token) ⇒ Array<Object, Object>
Display all Venues for the client
35 36 37 38 |
# 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 = {}) ⇒ Object
Note:
Venue currently only accepts ‘name’
Create a new Venue
10 11 12 |
# File 'lib/tacore/venue.rb', line 10 def self.create(token, venue = {}) request(:post, '/venue', venue, {"token": token}) end |
.destroy(token, venue_id) ⇒ Hash, status: 410
This method will permanently remove the venue from the API.
45 46 47 |
# 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) ⇒ Hash, status: 200
Get all gateways belonging to the given venue
53 54 55 |
# 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) ⇒ Object
Get back Venue information
27 28 29 |
# 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 = {}) ⇒ Object
Note:
Venue currently only accepts ‘name’
Update a Venue.
19 20 21 |
# 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 |