Class: Setka::Workflow::Category

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

Class Method Summary collapse

Methods inherited from Resource

actual_client, collection, member

Class Method Details

.create(body, options = {}) ⇒ Hash

Creates a category.

Parameters:

  • Attributes of a new category.

  • (defaults to: {})

    Additional options (explicit HTTP headers, specific Client object).

Returns:

  • Hash of category's attibutes.

Raises:

  • If something went wrong during category's creation.



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

def create(body, options = {})
  collection(:post, nil, body, options)
end

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

Deletes a category.

Parameters:

  • Category's id

  • (defaults to: {})

    Additional options (explicit HTTP headers, specific Client object).

Returns:

  • Hash of category's attibutes.

Raises:

  • If something went wrong during category's deleting.



47
48
49
# File 'lib/setka/workflow/category.rb', line 47

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

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

Updates a category.

Parameters:

  • Category's id

  • Category's attributes to update.

  • (defaults to: {})

    Additional options (explicit HTTP headers, specific Client object).

Returns:

  • Hash of category's attibutes.

Raises:

  • If something went wrong during category's updating.



33
34
35
# File 'lib/setka/workflow/category.rb', line 33

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