class Dirigible::Feed

@note The Feed API still uses the version 1 Push API. In the future it will be upgraded to use the V3 push API. @see docs.urbanairship.com/reference/api/v3/feeds.html

Public Class Methods

create(params) click to toggle source

Creates a new feed.

@example Example request:

Dirigible::Feed.create({
  feed_url: "http://example.com/atom.xml",
  template: {
    aps: {
      badge: 1,
      sound: "cat.caf",
      alert: "New item from some place! {{ title }}"
    }
  }
})

@see docs.urbanairship.com/reference/api/v3/feeds.html#creating-a-new-feed

# File lib/dirigible/feed.rb, line 19
def self.create(params)
  Dirigible.post('/feeds', params)
end
delete(id) click to toggle source

Removes a feed from the monitoring service, and stops new pushes from being sent.

@example Example request:

Dirigible::Feed.delete('<feed_id>')

@see docs.urbanairship.com/reference/api/v3/feeds.html#deleting-a-feed

# File lib/dirigible/feed.rb, line 58
def self.delete(id)
  Dirigible.delete("/feeds/#{id}")
end
get(id) click to toggle source

Returns information about that particular feed.

@example Example request:

Dirigible::Feed.get('<feed_id>')

@see docs.urbanairship.com/reference/api/v3/feeds.html#feed-details

# File lib/dirigible/feed.rb, line 29
def self.get(id)
  Dirigible.get("/feeds/#{id}")
end
update(id, params) click to toggle source

Updates a feed with a new template

@example Example request:

Dirigible::Feed.update('<feed_id>', {
  template: {
    aps: {
      sound: "frog.caf",
      alert: "New update from Someplace! - {{ title }}"
    }
  },
  feed_url: "<new_feed_url>"
})

@see docs.urbanairship.com/reference/api/v3/feeds.html#updating-a-feed

# File lib/dirigible/feed.rb, line 47
def self.update(id, params)
  Dirigible.put("/feeds/#{id}", params)
end