class Passworks::PassResource
Represents a Pass of a given collection type Coupon, Boarding Pass, Event Ticket, Generic, Store Card
Public Instance Methods
delete()
click to toggle source
Deletes the current pass @return [Boolean] True in case the pass is deleted
# File lib/passworks/pass_resource.rb, line 11 def delete client.delete("#{collection_name}/#{collection_uuid}/passes/#{id}").ok? end
push(options={})
click to toggle source
Sends a push notification to all clients with this pass installed @return [Boolean] True in case the pass
# File lib/passworks/pass_resource.rb, line 17 def push(options={}) options = { body: options } unless options.empty? client.post("#{collection_name}/#{collection_uuid}/passes/#{id}/push", options).ok? end
update(data, params={})
click to toggle source
Updates the {PassResource} and returns the updated instance @return [PassResource] Updated instance
# File lib/passworks/pass_resource.rb, line 24 def update(data, params={}) content = { body: { pass: data }.merge(params) } response = client.patch("#{collection_name}/#{collection_uuid}/passes/#{id}", content) self.class.new(client, collection_name, response.data) end
Private Instance Methods
collection_uuid()
click to toggle source
# File lib/passworks/pass_resource.rb, line 35 def collection_uuid @collection_uuid ||= campaign_id end