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:

  • body (Hash)

    Attributes of a new category.

  • options (Hash) (defaults to: {})

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

Returns:

  • (Hash)

    Hash of category’s attibutes.

Raises:



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:

  • id (Integer)

    Category’s id

  • options (Hash) (defaults to: {})

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

Returns:

  • (Hash)

    Hash of category’s attibutes.

Raises:



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:

  • id (Integer)

    Category’s id

  • body (Hash)

    Category’s attributes to update.

  • options (Hash) (defaults to: {})

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

Returns:

  • (Hash)

    Hash of category’s attibutes.

Raises:



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

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