Sha256: b045de001947b67abc30a57e2a3fdc0729eb18a9f1c27df0a7a01ff3baea05bd

Contents?: true

Size: 287 Bytes

Versions: 2

Compression:

Stored size: 287 Bytes

Contents

require 'net/http'
require 'uri'
require 'json'
require_relative './result'

module GET
  def self.call(url)
    response = Net::HTTP.get_response(URI(url))

    if Net::HTTPOK == response.code_type
      Success.new(response)
    else
      RequestError.new(response)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
trav3-0.0.2 lib/trav3/get.rb
trav3-0.0.1 lib/trav3/get.rb