Sha256: 1464bcd15af22425831400f41976c19eddc5e91209a89e663e6c13548720558f

Contents?: true

Size: 490 Bytes

Versions: 1

Compression:

Stored size: 490 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 = {})
      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

1 entries across 1 versions & 1 rubygems

Version Path
washbullet-0.4.0 lib/washbullet/request.rb