Class: Setka::Workflow::Ticket

Inherits:
Resource
  • Object
show all
Defined in:
lib/setka/workflow/ticket.rb

Class Method Summary collapse

Methods inherited from Resource

actual_client, collection, member

Class Method Details

.publish(id, options = {}) ⇒ Hash

Publishes a ticket.

Raises:

  • (Workflow::Ticket)

    if a ticket with the given ID could not be found, if the ticket is already published.



17
18
19
# File 'lib/setka/workflow/ticket.rb', line 17

def publish(id, options = {})
  member(:patch, id, :publish, nil, options)
end

.sync_analytics(body, options = {}) ⇒ Array

Sync ticket’s analytics.



62
63
64
# File 'lib/setka/workflow/ticket.rb', line 62

def sync_analytics(body, options = {})
  collection(:patch, :sync_analytics, body, options)
end

.unpublish(id, options = {}) ⇒ Hash

Unpublishes a ticket.

Raises:

  • (Workflow::Ticket)

    if a ticket with the given ID could not be found, if the ticket is already unpublished.



32
33
34
# File 'lib/setka/workflow/ticket.rb', line 32

def unpublish(id, options = {})
  member(:patch, id, :unpublish, nil, options)
end

.update(id, body, options = {}) ⇒ Hash

Updates a ticket.

Raises:

  • (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).



49
50
51
# File 'lib/setka/workflow/ticket.rb', line 49

def update(id, body, options = {})
  member(:patch, id, nil, body, options)
end