class Basecamp3::Project

A model for Basecamp's Project (Basecamp)

{github.com/basecamp/bc3-api/blob/master/sections/basecamps.md#basecamps For more information, see the official Basecamp3 API documentation for Basecamps}

Constants

REQUIRED_FIELDS

Attributes

bookmarked[RW]
created_at[RW]
description[RW]
id[RW]
name[RW]
status[RW]
updated_at[RW]

Public Class Methods

all(params = {}) click to toggle source

Returns a paginated list of active projects (basecamps) visible to the current user sorted by most recently created project (basecamp) first.

@param [Hash] params additional parameters @option params [Integer] :page (optional) to paginate results @option params [String] :status (optional) when set to archived or trashed, will return archived or trashed projects (basecamps) visible to the current user

@return [Array<Basecamp3::Project>]

# File lib/basecamp3/models/project.rb, line 24
def self.all(params = {})
  Basecamp3.request.get("/projects", params, Basecamp3::Project)
end
create(data) click to toggle source

Creates a project.

@param [Hash] data the data to create a project with @option params [String] :name (required) the name of the project @option params [String] :description (optional) the description of the project

@return [Basecamp3::Project]

# File lib/basecamp3/models/project.rb, line 44
def self.create(data)
  self.validate_required(data)
  Basecamp3.request.post("/projects", data, Basecamp3::Project)
end
delete(id) click to toggle source

Deletes the project.

@param [Integer] id the id of the project

@return [Boolean]

# File lib/basecamp3/models/project.rb, line 67
def self.delete(id)
  Basecamp3.request.delete("/projects/#{id}")
end
find(id) click to toggle source

Returns the project (basecamp).

@param [Integer] id the id of the project

@return [Basecamp3::Project]

# File lib/basecamp3/models/project.rb, line 33
def self.find(id)
  Basecamp3.request.get("/projects/#{id}", {}, Basecamp3::Project)
end
update(id, data) click to toggle source

Updates the project.

@param [Integer] id the id of the project @param [Hash] data the data to update the project with @option params [String] :name (required) the name of the project @option params [String] :description (optional) the description of the project

@return [Basecamp3::Project]

# File lib/basecamp3/models/project.rb, line 57
def self.update(id, data)
  self.validate_required(data)
  Basecamp3.request.put("/projects/#{id}", data, Basecamp3::Project)
end