Module: PivotalAPI

Defined in:
lib/pivotal/pivotal-api.rb

Defined Under Namespace

Classes: Activity, AllActivity, Base, Error, Iteration, Membership, Note, Project, Story, Task, Token

Class Method Summary collapse

Class Method Details

.authenticate(user, password) ⇒ Object

Sets up basic authentication credentials for all the resources.



9
10
11
12
13
14
15
# File 'lib/pivotal/pivotal-api.rb', line 9

def authenticate(user, password)
  Token.user = user
  Token.password = password
  self.token = Token.get(:active)['guid']
  Token.user = nil
  Token.password = nil
end

.resourcesObject



25
26
27
# File 'lib/pivotal/pivotal-api.rb', line 25

def resources
  @resources ||= []
end

.token=(value) ⇒ Object

Sets the API token for all the resources.



18
19
20
21
22
23
# File 'lib/pivotal/pivotal-api.rb', line 18

def token=(value)
  resources.each do |klass|
    klass.headers['X-TrackerToken'] = value
  end
  @token = value
end