Class: MyTargetApi::LogRequestParametersDecorator

Inherits:
Object
  • Object
show all
Defined in:
lib/my_target_api/log_request_parameters_decorator.rb

Overview

Requests

Instance Method Summary collapse

Constructor Details

#initialize(origin, options = {}) ⇒ LogRequestParametersDecorator

Returns a new instance of LogRequestParametersDecorator.



11
12
13
14
# File 'lib/my_target_api/log_request_parameters_decorator.rb', line 11

def initialize(origin, options = {})
  @origin = origin
  @options = options
end

Instance Method Details

#delete(url, params = {}) ⇒ Object



28
29
30
31
32
# File 'lib/my_target_api/log_request_parameters_decorator.rb', line 28

def delete(url, params = {})
  log_hash(method: 'Request#delete', url: url, params: params)

  origin.delete(url, params)
end

#get(url, params = {}) ⇒ Object



16
17
18
19
20
# File 'lib/my_target_api/log_request_parameters_decorator.rb', line 16

def get(url, params = {})
  log_hash(method: 'Request#get', url: url, params: params)

  origin.get(url, params)
end

#post(url, params = {}) ⇒ Object



22
23
24
25
26
# File 'lib/my_target_api/log_request_parameters_decorator.rb', line 22

def post(url, params = {})
  log_hash(method: 'Request#post', url: url, params: params)

  origin.post(url, params)
end

#upload(url, content, params = {}) ⇒ Object



34
35
36
37
38
# File 'lib/my_target_api/log_request_parameters_decorator.rb', line 34

def upload(url, content, params = {})
  log_hash(method: 'Request#upload', url: url, params: params, content: 'no logging')

  origin.upload(url, content, params)
end