Sha256: de89be88eb684c2cf69f51309e4bb2b36b1549c5868f3c67e6edfcf565e15e45
Contents?: true
Size: 1004 Bytes
Versions: 26
Compression:
Stored size: 1004 Bytes
Contents
module Loquor class HttpAction::Put < HttpAction def self.put(url, payload, deps) new(url, payload, deps).put end def initialize(url, payload, deps) super(url, deps) @payload = payload end def put @config.logger.info "Making put request to: #{full_url}" response = JSON.parse(signed_request.execute) @config.logger.info "Signed request executed. Response: #{response}" Resource.new(response) end private def signed_request signed_request = super p signed_request # If you take this line out - it all breaks. Yeah... signed_request end def request RestClient::Request.new(url: full_url, accept: :json, payload: @payload.to_json, headers: {'Content-type' => 'application/json'}, method: :put) end def full_url "#{@config.endpoint}#{@url}" end end end
Version data entries
26 entries across 26 versions & 1 rubygems