class Setka::Workflow::Ticket

Public Class Methods

publish(id, options = {}) click to toggle source

Publishes a ticket.

@param [Integer] id Ticket's id.

@param [Hash] options Additional options (explicit HTTP headers,

specific Client object).

@raise [Workflow::Ticket] if a ticket with the given ID could not be found,

if the ticket is already published.

@return [Hash] Hash of ticket's attibutes.

# File lib/setka/workflow/ticket.rb, line 17
def publish(id, options = {})
  member(:patch, id, :publish, nil, options)
end
sync_analytics(body, options = {}) click to toggle source

Sync ticket's analytics.

@param [Hash] body Hash with ticket's attributes to update.

@param [Hash] options Additional options (explicit HTTP headers,

specific Client object).

@return [Array] Array of hashes with ticket's views and comment counts

and the result of syncing.
# File lib/setka/workflow/ticket.rb, line 62
def sync_analytics(body, options = {})
  collection(:patch, :sync_analytics, body, options)
end
unpublish(id, options = {}) click to toggle source

Unpublishes a ticket.

@param [Integer] id Ticket's id.

@param [Hash] options Additional options (explicit HTTP headers,

specific Client object).

@raise [Workflow::Ticket] if a ticket with the given ID could not be found,

if the ticket is already unpublished.

@return [Hash] Hash of ticket's attibutes.

# File lib/setka/workflow/ticket.rb, line 32
def unpublish(id, options = {})
  member(:patch, id, :unpublish, nil, options)
end
update(id, body, options = {}) click to toggle source

Updates a ticket.

@param [Integer] id Ticket's id.

@param [Hash] body Hash with ticket's attributes to update.

@param [Hash] options Additional options (explicit HTTP headers,

specific Client object).

@raise [Workflow::Ticket] if a ticket with the given ID could not be found,

if format of some attribute(s) is wrong (e.g. date and published_at
should be passed as unix timestamps).

@return [Hash] Hash of ticket's attibutes.

# File lib/setka/workflow/ticket.rb, line 49
def update(id, body, options = {})
  member(:patch, id, nil, body, options)
end

Private Class Methods

resource_plural() click to toggle source
# File lib/setka/workflow/ticket.rb, line 68
def resource_plural
  :tickets
end