Module: Pivit::Request

Included in:
Client
Defined in:
lib/pivit/request.rb

Instance Method Summary collapse

Instance Method Details

#build_endpointString

Builds the api endpoint to reach the Pivotal Api the api endpoint to reach the Pivotal Api

Returns:

  • (String)

    Endpoint



26
27
28
29
30
31
# File 'lib/pivit/request.rb', line 26

def build_endpoint
  endpoint = ssl || self.api_token.nil? ? "https://" : "http://"
  endpoint << "#{self.username}:#{self.password}@" unless self.authenticated?
  endpoint << "www.pivotaltracker.com/services/v3/"
  self.api_endpoint = endpoint
end

#delete(path, options = {}) ⇒ Object



16
17
18
# File 'lib/pivit/request.rb', line 16

def delete(path, options={})
  request(:delete, path, options).body
end

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



3
4
5
6
# File 'lib/pivit/request.rb', line 3

def get(path, options = {})
  response = request(:get, path, options)
  response.body
end

#post(path, options = {}) ⇒ Object



8
9
10
# File 'lib/pivit/request.rb', line 8

def post(path, options = {})
  request(:post, path, options).body
end

#put(path, options = {}) ⇒ Object



12
13
14
# File 'lib/pivit/request.rb', line 12

def put(path, options={})
  request(:put, path, options).body
end