Class: PivotalSync::Client

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

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.token=(value) ⇒ Object (writeonly)

Sets the attribute token

Parameters:

  • value

    the value to set the attribute token to.



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

def token=(value)
  @token = value
end

Class Method Details

.clear_connectionsObject



19
20
21
# File 'lib/pivotal_sync/client.rb', line 19

def clear_connections
  @connections = nil
end

.connectionObject

Raises:

  • (NoToken)


9
10
11
12
13
14
15
16
17
# File 'lib/pivotal_sync/client.rb', line 9

def connection
  raise NoToken if @token.to_s.empty?
  
  @connections ||= {}
  @connections[@token] ||= RestClient::Resource.new("#{tracker_url}#{api_path}", :headers => {
    "X-TrackerToken" => @token, 
    "Content-Type" => "application/xml"
  })
end