Class: Mailtrap::ProjectsAPI

Inherits:
Object
  • Object
show all
Includes:
BaseAPI
Defined in:
lib/mailtrap/projects_api.rb

Instance Attribute Summary

Attributes included from BaseAPI

#account_id, #client

Instance Method Summary collapse

Methods included from BaseAPI

included, #initialize

Instance Method Details

#create(options) ⇒ Project

Creates a new project

Parameters:

  • options (Hash)

    The parameters to create

Options Hash (options):

  • :name (String)

    The project name

Returns:

  • (Project)

    Created project object

Raises:



36
37
38
# File 'lib/mailtrap/projects_api.rb', line 36

def create(options)
  base_create(options)
end

#delete(project_id) ⇒ Object

Deletes a project

Parameters:

  • project_id (Integer)

    The project ID

Returns:

  • nil

Raises:



54
55
56
# File 'lib/mailtrap/projects_api.rb', line 54

def delete(project_id)
  base_delete(project_id)
end

#get(project_id) ⇒ Project

Retrieves a specific project

Parameters:

  • project_id (Integer)

    The project ID

Returns:

Raises:



26
27
28
# File 'lib/mailtrap/projects_api.rb', line 26

def get(project_id)
  base_get(project_id)
end

#listArray<Project>

Lists all projects for the account

Returns:

  • (Array<Project>)

    Array of projects

Raises:



18
19
20
# File 'lib/mailtrap/projects_api.rb', line 18

def list
  base_list
end

#update(project_id, options) ⇒ Project

Updates an existing project

Parameters:

  • project_id (Integer)

    The project ID

  • options (Hash)

    The parameters to update

Returns:

  • (Project)

    Updated project object

Raises:



46
47
48
# File 'lib/mailtrap/projects_api.rb', line 46

def update(project_id, options)
  base_update(project_id, options)
end