Class: PacklinkLite::Client

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

Instance Method Summary collapse

Instance Method Details

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



20
21
22
23
24
25
# File 'lib/packlink_lite/client.rb', line 20

def delete(path, options = {})
  with_error_handling do
    response = connection(options[:api_key]).delete(path)
    response.body
  end
end

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



6
7
8
9
10
11
# File 'lib/packlink_lite/client.rb', line 6

def get(path, params = nil, options = {})
  with_error_handling do
    response = connection(options[:api_key]).get(path, params)
    response.body
  end
end

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



13
14
15
16
17
18
# File 'lib/packlink_lite/client.rb', line 13

def post(path, payload, options = {})
  with_error_handling do
    response = connection(options[:api_key]).post(path, payload)
    response.body
  end
end