Class: Tenk::Projects::Assignments

Inherits:
ProjectResource show all
Defined in:
lib/projects/assignments.rb

Overview

The API methods for Assignments which represent that a given user is assigned to a project or phase

Defined Under Namespace

Classes: CreateRequest, GetRequest, ListRequest, UpdateRequest

Instance Method Summary collapse

Methods inherited from ProjectResource

#initialize, #resource_root

Constructor Details

This class inherits a constructor from Tenk::Projects::ProjectResource

Instance Method Details

#create(project_id, opts = {}) ⇒ Hashie::Mash

Create a new Assignment for this project

Parameters:

  • project_id (Integer)

    the id of the project

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

    the post parameters to add to the create request

Returns:

  • (Hashie::Mash)

    the API response as a Hashie::Mash

See Also:



58
59
60
# File 'lib/projects/assignments.rb', line 58

def create(project_id, opts = {})
  super(project_id, CreateRequest.new(opts))
end

#delete(project_id, assignment_id) ⇒ bool

Delete an Assignment for this project

Parameters:

  • project_id (Integer)

    the id of the project

  • assignment_id (Integer)

    the id of the assignment

Returns:

  • (bool)

    true if successful



76
77
78
# File 'lib/projects/assignments.rb', line 76

def delete(project_id, assignment_id)
  super(project_id, assignment_id)
end

#get(project_id, assignment_id, opts = {}) ⇒ Hashie::Mash

Get a single Assignment for this project

Parameters:

  • project_id (Integer)

    the id of the project

  • assignment_id (Integer)

    the id of the assignment

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

    the query parameters to add to the get request

Returns:

  • (Hashie::Mash)

    the response as a Hashie::Mash

See Also:



49
50
51
# File 'lib/projects/assignments.rb', line 49

def get(project_id, assignment_id, opts = {})
  super(project_id, assignment_id, GetRequest.new(opts))
end

#list(project_id, opts = {}) ⇒ Hashie::Mash

List Assignments for a single project

Parameters:

  • project_id (Integer)

    the id of the project

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

    the query parameters to add to list request

Returns:

  • (Hashie::Mash)

    the API response as a Hashie::Mash

See Also:



39
40
41
# File 'lib/projects/assignments.rb', line 39

def list(project_id, opts = {})
  super(project_id, ListRequest.new(opts))
end

#update(project_id, assignment_id, opts = {}) ⇒ Hashie::Mash

Update an Assignment for this project

Parameters:

  • project_id (Integer)

    the id of the project

  • assignment_id (Integer)

    the id of the assignment

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

    the post parameters to add to the create request

Returns:

  • (Hashie::Mash)

    the API response as a Hashie::Mash

See Also:



68
69
70
# File 'lib/projects/assignments.rb', line 68

def update(project_id, assignment_id, opts = {})
  super(project_id, assignment_id, UpdateRequest.new(opts))
end