Module: Basecamp3

Defined in:
lib/basecamp3/concerns/bucketable.rb,
lib/basecamp3.rb,
lib/basecamp3/version.rb,
lib/basecamp3/concerns/parentable.rb,
lib/basecamp3/concerns/commentable.rb,
lib/basecamp3/concerns/creatorable.rb,
lib/basecamp3/concerns/recordingable.rb

Overview

A concern for recordingable models

Defined Under Namespace

Modules: Concerns Classes: Campfire, CampfireLine, Comment, Document, Forward, Inbox, Message, MessageBoard, MessageType, Model, Person, Project, Question, QuestionAnswer, Questionnaire, Request, ResponseParser, Schedule, ScheduleEntry, Todo, TodoList, TodoSet, TypeMapper, Vault

Constant Summary

HOST =
'https://3.basecampapi.com'
VERSION =
"0.1.0"

Class Method Summary collapse

Class Method Details

.connect(account_id, access_token) ⇒ Object

Establishes a connection with basecamp

Parameters:

  • account_id (Integer)

    the id of your basecamp account

  • access_token (Integer)

    the oauth2 access token



45
46
47
48
49
50
51
# File 'lib/basecamp3.rb', line 45

def connect(, access_token)
  @account_id = 
  @access_token = access_token
  @uri = URI.parse("#{HOST}/#{@account_id}")

  @request = Basecamp3::Request.new(@access_token, @uri)
end

.requestBasecamp3::Request

Returns the request object

Returns:

Raises:

  • (StandardError)

    raises an error if a connection is not established



57
58
59
# File 'lib/basecamp3.rb', line 57

def request
  @request || raise('You have to call Basecamp.connect method first')
end