Class: TimeCamp::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby-timecamp/request.rb

Constant Summary collapse

BASE_URL =
'https://www.timecamp.com/third_party/api/'
API_TOKEN =
ENV['TIMECAMP_API_TOKEN']

Class Method Summary collapse

Class Method Details

.delete(resource, opts = {}, data = {}) ⇒ Object



22
23
24
25
# File 'lib/ruby-timecamp/request.rb', line 22

def self.delete(resource, opts={}, data={})
  # return instance of response
  return request(:delete, resource, opts, data)
end

.get(resource, opts = {}, data = {}) ⇒ Object

RESTful METHODS



7
8
9
10
# File 'lib/ruby-timecamp/request.rb', line 7

def self.get(resource, opts={}, data={})
  # return instance of response
  return request(:get, resource, opts, data)
end

.post(resource, opts = {}, data = {}) ⇒ Object



12
13
14
15
# File 'lib/ruby-timecamp/request.rb', line 12

def self.post(resource, opts={}, data={})
  # return instance of response
  return request(:post, resource, opts, data)
end

.put(resource, opts = {}, data = {}) ⇒ Object



17
18
19
20
# File 'lib/ruby-timecamp/request.rb', line 17

def self.put(resource, opts={}, data={})
  # return instance of response
  return request(:put, resource, opts, data)
end