Sha256: 19a93930e893bdb91f5b9cb37217122e4b0ccfb8648dc9117546d85a5313a495

Contents?: true

Size: 428 Bytes

Versions: 1

Compression:

Stored size: 428 Bytes

Contents

require 'pushbullet/connection'

module Pushbullet
  module Request
    include Connection

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

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

    private

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pushbullet-0.0.4 lib/pushbullet/request.rb