Sha256: 4a6431bf20d3333a8f5792b991e85f8384a53b9305a4d9b713d4ce59d982d373

Contents?: true

Size: 537 Bytes

Versions: 3

Compression:

Stored size: 537 Bytes

Contents

module Loquor
  class HttpAction::Get < HttpAction
    def self.get(url, deps)
      new(url, deps).get
    end

    def initialize(url, deps)
      super
    end

    def get
      @config.logger.info "Making GET request to: #{@url}"
      response = JSON.parse(signed_request.execute)
      @config.logger.info "Signed request executed. Response: #{response}"
      response
    end

    private
    def request
      full_url = "#{@config.endpoint}#{@url}"
      RestClient::Request.new(url: full_url, method: :get)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
loquor-0.1.1 lib/loquor/http_actions/get.rb
loquor-0.1.0 lib/loquor/http_actions/get.rb
loquor-0.0.2 lib/loquor/http_actions/get.rb