Class: Dirigible::Tag
- Inherits:
-
Object
- Object
- Dirigible::Tag
- Defined in:
- lib/dirigible/tag.rb
Overview
Class Method Summary collapse
-
.add_or_remove(tag, params) ⇒ Object
Add or remove one or more device tokens, APIDs, or PINs to a particular tag.
-
.batch(params) ⇒ Object
Modify the tags for a number of device tokens or apids.
-
.create(tag) ⇒ Object
Explicitly create a tag with no devices associated with it.
-
.delete(tag) ⇒ Object
Delete a tag and remove it from all devices.
-
.list ⇒ Object
List tags that exist for this application.
Class Method Details
.add_or_remove(tag, params) ⇒ Object
Add or remove one or more device tokens, APIDs, or PINs to a particular tag.
70 71 72 |
# File 'lib/dirigible/tag.rb', line 70 def self.add_or_remove(tag, params) Dirigible.post("/tags/#{tag}", params) end |
.batch(params) ⇒ Object
Modify the tags for a number of device tokens or apids.
You must include an object containing either a device_token or apid section and also containing a tags section to apply the tags.
109 110 111 |
# File 'lib/dirigible/tag.rb', line 109 def self.batch(params) Dirigible.post("/tags/batch", params) end |
.create(tag) ⇒ Object
This call is optional; tags are created implicitly when devices are added to them. You might use this to pre-create the list for your Push Composer users, however.
Explicitly create a tag with no devices associated with it.
21 22 23 |
# File 'lib/dirigible/tag.rb', line 21 def self.create(tag) Dirigible.put("/tags/#{tag}") end |
.delete(tag) ⇒ Object
The removal process can take a long time if many devices use this tag.
Delete a tag and remove it from all devices.
A tag can be fully removed from Urban Airship by issuing a delete. This will remove the master record of the tag, and will remove the tag from all devices.
36 37 38 |
# File 'lib/dirigible/tag.rb', line 36 def self.delete(tag) Dirigible.delete("/tags/#{tag}") end |
.list ⇒ Object
List tags that exist for this application.
9 10 11 |
# File 'lib/dirigible/tag.rb', line 9 def self.list Dirigible.get('/tags') end |