Sha256: 0fd473ef2563e7b33b645fdea904718698d7c92b57c765f3dd40907b74946216

Contents?: true

Size: 725 Bytes

Versions: 5

Compression:

Stored size: 725 Bytes

Contents

class UnderOs::HTTP
  def self.get(url, options={}, &block)
    request url, options.merge(method: :get), &block
  end

  def self.post(url, options={}, &block)
    request url, options.merge(method: :post), &block
  end

  def self.put(url, options={}, &block)
    request url, options.merge(method: :put), &block
  end

  def self.patch(url, options={}, &block)
    request url, options.merge(method: :patch), &block
  end

  def self.head(url, options={}, &block)
    request url, options.merge(method: :head), &block
  end

  def self.delete(url, options={}, &block)
    request url, options.merge(method: :delete), &block
  end

protected

  def self.request(*args, &block)
    Request.new(*args, &block).send
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
under-os-http-1.4.0 lib/under_os/http.rb
under-os-1.3.0 lib/under_os/http.rb
under-os-1.2.1 lib/under_os/http.rb
under-os-1.2.0 lib/under_os/http.rb
under-os-1.1.0 lib/under_os/http.rb