Sha256: 82c327408e509219c18c5c428f13bac4c29ead204f18613feaf6a12afbb3c99b

Contents?: true

Size: 599 Bytes

Versions: 5

Compression:

Stored size: 599 Bytes

Contents

require 'openssl'

require "pushpad/request"
require "pushpad/notification"
require "pushpad/subscription"

module Pushpad
  @@auth_token = nil
  @@project_id = nil

  def self.auth_token
    @@auth_token
  end

  def self.auth_token=(auth_token)
    @@auth_token = auth_token
  end

  def self.project_id
    @@project_id
  end

  def self.project_id=(project_id)
    @@project_id = project_id
  end

  def self.signature_for(data)
    raise "You must set Pushpad.auth_token" unless Pushpad.auth_token
    OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new('sha1'), self.auth_token, data.to_s)
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
pushpad-0.13.0 lib/pushpad.rb
pushpad-0.12.0 lib/pushpad.rb
pushpad-0.11.1 lib/pushpad.rb
pushpad-0.11.0 lib/pushpad.rb
pushpad-0.10.0 lib/pushpad.rb