Module: Camper::Client::Projects

Included in:
Camper::Client
Defined in:
lib/camper/client/projects.rb

Instance Method Summary (collapse)

Instance Method Details

- (Array, false) archived_projects

Get all the archived projects the authenticated user has access to

Returns:

  • (Array, false)

    if successful, returns an Array of Camper::Project objects. Otherwise, returns false.



17
18
19
# File 'lib/camper/client/projects.rb', line 17

def archived_projects
  handle Camper::Project, get("projects/archived")
end

- (Camper::Project, false) create_project!(body)

Create a new project

Parameters:

  • body (Hash)

    the data to be sent via POST

Options Hash (body):

  • :name (String)

    The name of the project

  • :description (String)

    The description of the project

Returns:

  • (Camper::Project, false)

    returns a Camper::Project object if request is successful, otherwise returns false



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

def create_project!(body)
  handle Camper::Project, post("projects", body)
end

- (Camper::Project, false) project(id)

Get a single project's data

Parameters:

  • id (Fixnum, String)

    the ID of the user wanted

Returns:

  • (Camper::Project, false)

    returns a Camper::Project object if request is successful, otherwise returns false



27
28
29
# File 'lib/camper/client/projects.rb', line 27

def project(id)
  handle Camper::Project, get("projects/#{id}")
end

- (Array, false) projects

Get all the projects the authenticated user has access to

Returns:

  • (Array, false)

    if successful, returns an Array of Camper::Project objects. Otherwise, returns false.



9
10
11
# File 'lib/camper/client/projects.rb', line 9

def projects
  handle Camper::Project, get("projects")
end