Class: SmartProxyDynflowCore::Callback::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/smart_proxy_dynflow_core/callback.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.callback(callback, data) ⇒ Object



20
21
22
# File 'lib/smart_proxy_dynflow_core/callback.rb', line 20

def self.callback(callback, data)
  self.new.callback(self.prepare_payload(callback, data))
end

Instance Method Details

#callback(payload) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/smart_proxy_dynflow_core/callback.rb', line 12

def callback(payload)
  response = callback_resource.post payload
  if response.code != 200
    raise "Failed performing callback to smart proxy: #{response.code} #{response.body}"
  end
  response
end