Class: Pivotal::Api

Inherits:
Base
  • Object
show all
Defined in:
lib/pivotal/api.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#xml

Instance Method Summary collapse

Methods inherited from Base

name_as_xml_attribute, #parsed_resource, #update_attributes, xpath

Methods included from Attributes

included

Methods included from Associations

included

Constructor Details

#initialize(options = {}) ⇒ Api

Returns a new instance of Api.



7
8
9
10
# File 'lib/pivotal/api.rb', line 7

def initialize(options = {})
  super(options)
  @api_url = "https://www.pivotaltracker.com/services/v3"
end

Instance Attribute Details

#api_tokenObject

Returns the value of attribute api_token.



4
5
6
# File 'lib/pivotal/api.rb', line 4

def api_token
  @api_token
end

Instance Method Details

#resourceObject



12
13
14
# File 'lib/pivotal/api.rb', line 12

def resource
  @resource ||= RestClient::Resource.new @api_url, :headers => { 'X-TrackerToken' => api_token, 'Content-Type' => 'application/xml' }
end