Class: Pivotalprinter::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/pivotalprinter/client.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.projectObject

Returns the value of attribute project.



7
8
9
# File 'lib/pivotalprinter/client.rb', line 7

def project
  @project
end

.tokenObject

Returns the value of attribute token.



7
8
9
# File 'lib/pivotalprinter/client.rb', line 7

def token
  @token
end

Class Method Details

.get(path, options = {}) ⇒ Object

Raises:



9
10
11
12
13
14
# File 'lib/pivotalprinter/client.rb', line 9

def get(path, options={})
  raise TokenMissing if @token.nil?
  raise ProjectMissing if @project.nil?
  response = open("http://www.pivotaltracker.com/services/v3#{path}", 'X-TrackerToken' => @token, 'Content-Type' => 'application/xml').read
  Nokogiri::XML.parse(response)
end