Sha256: 638643ef6a65051937ed9060253bd8b4c503c7c7ea29a944f085aff781957658

Contents?: true

Size: 501 Bytes

Versions: 2

Compression:

Stored size: 501 Bytes

Contents

module Washbullet
  module Request
    def get(path, params = {})
      request(:get, path, params)
    end

    def post(path, payload)
      request(:post, path, payload)
    end

    def delete(path)
      request(:delete, path)
    end

    private

    def request(method, path, params = {})
      response = connection.send(method) {|request|
        request.url path
        request.params = params if method == :get
        request.body   = params if method == :post
      }
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
washbullet-0.3.1 lib/washbullet/request.rb
washbullet-0.3.0 lib/washbullet/request.rb