lib/zero_push.rb in zero_push-0.0.4 vs lib/zero_push.rb in zero_push-0.0.5

- old
+ new

@@ -1,36 +1,3 @@ require 'zero_push/version' +require 'zero_push/client' require 'faraday' - -module ZeroPush - URL = "https://api.zeropush.com" - - class << self - attr_accessor :auth_token - - # verifies credentials - # - # @return [Boolean] - def verify_credentials - response = client.get('/api/verify_credentials') - response.status == 200 - end - - # Sends a notification to the list of devices - # - # @param params [Hash] - # @return response - def notify(params) - client.post('/api/notify', params) - end - - # the HTTP client configured for API requests - # - def client - Faraday.new(url: URL) do |c| - c.token_auth self.auth_token - c.request :url_encoded # form-encode POST params - c.adapter Faraday.default_adapter # Net::HTTP - end - end - end -end