Sha256: c1e2a67e3d2b54d61d8fcf73e7867459476525d48d80533756735fc0220979b7

Contents?: true

Size: 556 Bytes

Versions: 8

Compression:

Stored size: 556 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: #{full_url}"
      response = JSON.parse(signed_request.execute)
      @config.logger.info "Signed request executed. Response: #{response}"
      response
    end

    private
    def request
      RestClient::Request.new(url: full_url, method: :get)
    end

    def full_url
      "#{@config.endpoint}#{@url}"
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
loquor-0.5.3 lib/loquor/http_actions/get.rb
loquor-0.5.2 lib/loquor/http_actions/get.rb
loquor-0.5.1 lib/loquor/http_actions/get.rb
loquor-0.5.0 lib/loquor/http_actions/get.rb
loquor-0.4.0 lib/loquor/http_actions/get.rb
loquor-0.3.0 lib/loquor/http_actions/get.rb
loquor-0.2.0 lib/loquor/http_actions/get.rb
loquor-0.1.2 lib/loquor/http_actions/get.rb