Skip to content

Instantly share code, notes, and snippets.

@adamlogic
Created August 29, 2009 17:41
Show Gist options
  • Save adamlogic/177602 to your computer and use it in GitHub Desktop.
Save adamlogic/177602 to your computer and use it in GitHub Desktop.
class Tracker
include HTTParty
TOKEN = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
base_uri 'www.pivotaltracker.com'
def self.projects
api_get 'projects'
end
def self.project(id)
api_get "projects/#{id}"
end
def self.stories(id)
api_get "projects/#{id}/stories"
end
private
def self.api_get(path, options = {})
get "/services/v2/#{path}", options.merge(:headers => {"X-TrackerToken" => TOKEN})
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment