Sha256: 38e0858ea8b74408852848b4fca1b2aa973142b0c537b0fd2d853e44a5a6dc6f
Contents?: true
Size: 1.03 KB
Versions: 7
Compression:
Stored size: 1.03 KB
Contents
require 'passworks/resource' module Passworks # Represents a Campaign of a given type: Coupon, Boarding Pass, Event Ticket, Generic, Store Card # class CampaignResource < Resource # @return [RequestProxy] def passes(options={}) Passworks::RequestProxy.new(client, collection_name, id, options) end # Deletes the current Campaign # @return [Boolean] def delete client.delete("#{collection_name}/#{id}").ok? end # Send push notifications to all customers that have installed passes from this campaign # @return [Boolean] def push client.post("#{collection_name}/#{id}/push").ok? end # Updates the {CampaignResource} and returns the updated instance # @return [CampaignResource] Updated instance def update(data, params={}) content = { body: { single_name.to_sym => data }.merge(params) } response = client.patch("#{collection_name}/#{id}", content) self.class.new(client, collection_name, response.data) end end end
Version data entries
7 entries across 7 versions & 1 rubygems